= Solution
On an interval avoiding $x=0$, divide by $x$ to obtain the first-order <linear ordinary differential equation>
$$
y'-\frac2x y=x^3\cos x.
$$
An <integrating factor> is $\mu(x)=\exp\!\left(\int-2/x\,dx\right)=x^{-2}$. Multiplying through and using the <product rule> gives
$$
\frac{d}{dx}(x^{-2}y)=x\cos x.
$$
By <integration by parts>, $\int x\cos x\,dx=x\sin x+\cos x+C$. Consequently
$$
\boxed{y(x)=x^2\bigl(x\sin x+\cos x+C\bigr)}.
$$
The formula differentiates back to the original equation. Although division excluded $x=0$, this formula has a smooth extension there with $y(0)=0$, satisfying the original equation at zero as well.
Back to article page