My Coding > Mathematics > First order ordinary differential equations > Solving x^2y' + 2xy = cos^2x

Solving x^2y' + 2xy = cos^2x

In this lecture, I will show you how to solve the \(x^2y\prime + 2xy = \cos^2{x}\) equation.

As you can see, this is a first-order differential equation, which needs to be solved with an integration factor. Our plan is very simple again, we need to find an international factor and then solve this equation, so let's do it!

The first step is to convert this equation to a canonical form.

\[x^2y\prime + 2xy = \cos^2{x}\]

\[y\prime + \frac{2x}{x^2}y = \frac{\cos^2{x}}{x^2}\]

\[y\prime + \frac{2}{x}y = \frac{\cos^2{x}}{x^2}\]

And now we need to introduce an integrational factor:

\[Iy\prime + I\frac{2}{x}y = I\frac{\cos^2{x}}{x^2}\]

Product rule:

\[(Iy)\prime = Iy\prime + I\prime y\]

Due to the arbitrary form, of \(I\), we can require the equality of the terms in the sum:

\[I\frac{2}{x}y = I\prime y \Rightarrow I\prime = I\frac{2}{x}\]

and solve it against \(I\):

\[\frac{\mathop{dI}}{I} = \frac{2\mathop{dx}}{x}\]

\[\int \frac{\mathop{dI}}{I} = \int \frac{2\mathop{dx}}{x} \Rightarrow \ln{\left|I\right|} = 2\ln{\left|x\right|} + C \]

\[\ln{\left|I\right|} = \ln{Ax^2}\]

\[e^{\ln{\left|I\right|}} = e^{\ln{Ax^2}}\]

\[\boxed{I = x^2}\]

\[(Iy)\prime = I\frac{\cos^2{x}}{x^2}\]

\[(Iy)\prime = x^2\frac{\cos^2{x}}{x^2}\]

\[(Iy)\prime = \cos^2{x}\]

Now integrate both parts and:

\[Iy = \int \cos^2{x}\mathop{dx} + C\]

To integrate it, we need to use the following triginometrical equality:

\[\cos^2{x} = \frac{\cos{2x} + 1}{2}\]

\[x^2y = \frac{\sin{2x}}{4} + \frac{x}{2} + C\]

and finally:

\[\boxed{y = \frac{\sin{2x}}{4x^2} + \frac{1}{2x} + \frac{C}{x^2}}\]

For more details, how to solve \(x^2y\prime + 2xy = \cos^2{x}\), please watch this video:

Published: 2023-05-14 04:50:38
Updated: 2023-05-14 05:30:54

Last 10 artitles

9 popular artitles

© 2020 -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit.