\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Solve the equations

\begin{description}
\item[(i)]
$\ds\frac{d^2y}{dx^2}=x+\sin x$

\item[(ii)]
$\ds\frac{d^2y}{dx^2}=3x^2$ given that when $x=1,\ y=0,\
\ds\frac{dy}{dx}=3$.
\end{description}
\medskip

{\bf Answer}
\begin{description}
\item[(i)]
$\ds\frac{d^2y}{dx^2}=x+\sin x$ This is of the form
$\ds\frac{d^2y}{dx^2}=f(x)$

so can be integrated directly

$\ \ds\frac{d^2y}{dx^2}=x+\sin x$

$\Rightarrow \ds\frac{dy}{dx}=\ds\int(x+\sin x)\,dx =
\ds\frac{x^2}{2}-\cos x+C$

$\Rightarrow y=\ds\int\left(\ds\frac{x^2}{2}-\cos x+C\right)
\,dx=\ds\frac{x^3}{6}-\sin x+Cx+D$

$C,\ D$ arbitrary

$\Rightarrow \un{y=\ds\frac{x^3}{6}-\sin x+Cx+D}$

\item[(ii)]
$\ds\frac{d^2y}{dx^2}=3x^2$ is of the form
$\ds\frac{d^2y}{dx^2}=f(x)$, so can be integrated directly.

$\ds\frac{d^2y}{dx^2}=3x^2$

$\Rightarrow \ds\frac{Dy}{dx}=\ds\int3x^2 \,dx = x^3+C$

Now use 1st boundary condition to find $C$: $\ds\frac{dy}{dx}=3$
when $x=1$

Thus $3=1^3+C \Rightarrow C=2$

Thus $\ds\frac{dy}{dx}=x^3+2$

Thus $y=\ds\int(x^3+2) \,dx=\ds\frac{x^4}{4}+2x+D$

Now use 2nd boundary condition to find $D$: $y=0$ when $x=1$

Thus $0=\ds\frac{1^4}{4}+2\times 1+D \Rightarrow -\ds\frac{9}{4}$

Thus the particular solution is:

$$\un{y=\ds\frac{x^4}{4}+2x-\ds\frac{9}{4}}$$
\end{description}

\end{document}
