02-06-2023

Problem: Solve the differential equation \[ \frac{\mathrm{d}y}{\mathrm{d}x} + \frac{1}{x}\sin 2y = x^{2} \cos ^2y. \]

Solution: This is called a Bernoulli's equation. To solve this we need to find an integrating factor. First let us simplify the problem. Note that \begin{align*} & \frac{\mathrm{d}y}{\mathrm{d}x} + \frac{1}{x}\sin 2y = x^2 \cos ^2 y \\ \implies & \frac{1}{\cos ^2 y} \frac{\mathrm{d}y}{\mathrm{d}x} + \frac{1}{x} \frac{2 \sin y \cos y}{\cos ^2 y} = x^2 \\ \implies & sec^2 y \frac{\mathrm{d}y}{\mathrm{d}x} + \frac{2}{x}\tan y = x^2. \end{align*} We take \[ u = \tan y \implies \frac{\mathrm{d}u}{\mathrm{d}x} = \sec^2 y \frac{\mathrm{d}y}{\mathrm{d}x} . \] Therefore, we have \begin{equation}\label{eq:01Jun2023-1} \frac{\mathrm{d}u}{\mathrm{d}x} + \frac{2}{x}u = x^2. \end{equation}


The integrating factor of this differential equation is \[ e^{\int \frac{2}{x}\mathrm{d} x} = e^{2\log x} = x^2. \] So, multiplying the differential equation \eqref{eq:01Jun2023-1} by the integrating factor we obtained \begin{align*} & x^2\left( \frac{\mathrm{d}u}{\mathrm{d}x} + \frac{2}{x}u \right) = x^4 \\ \implies & \int \mathrm{d} \left( ux^2 \right) = \int x^4 \mathrm{d} x \\ \implies & ux^2 = \frac{x^5}{5} + c \\ \implies & x^2 \tan y = \frac{x^5}{5} + c. \end{align*} Therefore, the solution of the given differential equation will be \[ \tan y = \frac{x^5}{5} + \frac{c}{x^2}, \] where $c$ is an arbitrary constant.