Find the general solution for each of the following differential equations. \mathrm{x} \frac{\mathrm{dy}}{\mathrm{dx}}+2 \mathrm{y}=\mathrm{x}^{2}
Find the general solution for each of the following differential equations. \mathrm{x} \frac{\mathrm{dy}}{\mathrm{dx}}+2 \mathrm{y}=\mathrm{x}^{2}

Solution:

x \frac{d y}{d x}+2 y=x^{2}\dots \dots (1)
To solve (1) we will use following formula
\begin{array}{l} \int \frac{1}{x} d x=\log x \\ \int x^{n} d x=\frac{x^{n}+1}{n+1}+c \\ a^{\log _{a} b}=\log b \\ a^{\log _{a} b}=b \end{array}
General solution for the differential equation in the form of
\frac{d y}{d x}+P y=Q
The general solution is given by,
y \cdot(I . F .)=\int Q \cdot(I . F .) d x+c
Where integrating factor,
\begin{array}{c} \text { I. } F .=e \int^{p d x} \\ x \frac{d y}{d x}+2 y=x^{2} \end{array}
Dividing the above equation by \mathrm{x},
\frac{d y}{d x}+\frac{2}{x} \cdot y=x \ldots \ldots \ldots(2)
Comparing (2) with
\frac{d y}{d x}+P y=Q
We get, \mathrm{P}=\frac{2}{x} and \mathrm{Q}=\mathrm{x}
Therefore, integrating factor is
\begin{aligned} \text { I.F. }=e \int^{p d x} & e^{\frac{2}{x} d x} \\ e^{2 \log x} &\left(\int \frac{1}{x} d x=\log x\right) \\ e^{2 \log x}-&(a \log b=\log a) \\ =x^{2}-\quad\left(a^{\log _{a} b}=\log b\right) & \end{aligned}
General solution is
\begin{array}{r} y \cdot(I . F .)=\int Q \cdot(I . F .) d x+c \\ y \cdot(x)=\int x \cdot\left(x^{2}\right) d x+c \\ x y=\int x^{3} d x+c \\ x^{2} y=\frac{x^{4}}{4}+C \ldots \ldots \ldots\left(\int x^{n} d x=\frac{x^{n+1}}{n+1}\right) \end{array}