Differential Equations

Prove that $y = a \cos \left(\log x\right) + b \sin \left(\log x\right)$ is a solution of the differential equation $x^2 \; \dfrac{d^2 y}{dx^2} + x \; \dfrac{dy}{dx} + y = 0$ where a and b are arbitrary constants.


Given: $y = a \cos \left(\log x\right) + b \sin \left(\log x\right)$ $\;\;\; \cdots \; (1)$

Differentiating equation $(1)$ w.r.t x gives

$\dfrac{dy}{dx} = - a \sin \left(\log x\right) \times \dfrac{1}{x} + b \cos \left(\log x\right) \times \dfrac{1}{x}$ $\;\;\; \cdots \; (2)$

Differentiating equation $(2)$ w.r.t x gives

$\begin{aligned} \dfrac{d^2 y}{dx^2} & = \dfrac{-a}{x} \cos \left(\log x\right) \times \dfrac{1}{x} + \dfrac{a}{x^2} \sin \left(\log x\right) - \dfrac{b}{x^2} \cos \left(\log x\right) - \dfrac{b}{x} \sin \left(\log x\right) \times \dfrac{1}{x} \\\\ & = \dfrac{-1}{x^2} \left[a \cos \left(\log x\right) + b \sin \left(\log x\right)\right] - \dfrac{1}{x} \left[\dfrac{b}{x} \cos \left(\log x\right) - \dfrac{a}{x} \sin \left(\log x\right)\right] \;\;\; \cdots \; (3) \end{aligned}$

$\therefore$ $\;$ In view of equations $(1)$ and $(2)$, equation $(3)$ becomes

$\dfrac{d^2 y}{dx^2} = \dfrac{-1}{x^2} \times y - \dfrac{1}{x} \times \dfrac{dy}{dx}$

i.e. $x^2 \; \dfrac{d^2 y}{dx^2} + x \; \dfrac{dy}{dx} + y = 0$

is the required differential equation.