Solve the differential equation $\frac{d y}{d x}=1+x+y^2+x y^2$, when $y=0$ and $x=0$.
$$\begin{aligned} \text{Given that,}\quad \frac{d y}{d x} & =1+x+y^2+x y^2 \\ \Rightarrow\quad\frac{d y}{d x} & =(1+x)+y^2(1+x) \\ \Rightarrow\quad\frac{d y}{d x} & =\left(1+y^2\right)(1+x) \\ \Rightarrow\quad\frac{d y}{1+y^2} & =(1+x) d x \end{aligned}$$
$$\begin{aligned} &\text { On integrating both sides, we get }\\ &\tan ^{-1} y=x+\frac{x^2}{2}+K\quad\text{.... (i)} \end{aligned}$$
When $y=0$ and $x=0$, then substituting these values in Eq. (i), we get
$$\begin{aligned} \tan ^{-1}(0) & =0+0+K \\ \Rightarrow \quad K & =0 \\ \Rightarrow \quad \tan ^{-1} y & =x+\frac{x^2}{2} \\ \Rightarrow \quad y & =\tan \left(x+\frac{x^2}{2}\right) \end{aligned}$$
Find the general solution of $\left(x+2 y^3\right) \frac{d y}{d x}=y$.
Given that, $$\left(x+2 y^3\right) \frac{d y}{d x}=y$$
$$\begin{array}{ll} \Rightarrow & y \cdot \frac{d x}{d y}=x+2 y^3 \\ \Rightarrow & \frac{d x}{d y}=\frac{x}{y}+2 y^2 \quad\text{[dividing throughout by y]}\\ \Rightarrow & \frac{d x}{d y}-\frac{x}{y}=2 y^2 \end{array}$$
which is a linear differential equation.
On comparing it with $\frac{d x}{d y}+P x=Q$, we get
$$ \begin{aligned} P & =-\frac{1}{y}, Q=2 y^2 \\ \mathrm{IF} & =e^{\int-\frac{1}{y} d y}=e^{-\int \frac{1}{y} d y} \\ \therefore\quad & =e^{-\log y}=\frac{1}{y} \end{aligned}$$
$$\begin{array}{ll} \text { The general solution is } & x \cdot \frac{1}{y}=\int 2 y^2 \cdot \frac{1}{y} d y+C \\ \Rightarrow & \frac{x}{y}=\frac{2 y^2}{2}+C \\ \Rightarrow & \frac{x}{y}=y^2+C \\ \Rightarrow & x=y^3+C y \end{array}$$
If $y(x)$ is a solution of $\left(\frac{2+\sin x}{1+y}\right) \frac{d y}{d x}=-\cos x$ and $y(0)=1$, then find the value of $y\left(\frac{\pi}{2}\right)$.
Given that, $\quad\left(\frac{2+\sin x}{1+y}\right) \frac{d y}{d x}=-\cos x$
$\Rightarrow \quad \frac{d y}{1+y}=-\frac{\cos x}{2+\sin x} d x$
On integrating both sides, we get
$$\int \frac{1}{1+y} d y=-\int \frac{\cos x}{2+\sin x} d x$$
$\Rightarrow \quad \log (1+y)=-\log (2+\sin x)+\log C$
$$\begin{array}{r} \Rightarrow & \log (1+y)+\log (2+\sin x)=\log C \\ \Rightarrow & \log (1+y)(2+\sin x)=\log C \\ \Rightarrow & (1+y)(2+\sin x)=C \\ \Rightarrow & 1+y=\frac{C}{2+\sin x} \\ \Rightarrow & y=\frac{C}{2+\sin x}-1\quad\text{.... (i)} \end{array}$$
$$ \begin{aligned} &\text { When } x=0 \text { and } y=1 \text {, then }\\ &1=\frac{C}{2}-1\\ \Rightarrow\quad &=C=4 \end{aligned}$$
On putting C = 4 in Eq. (i), we get
$$\begin{aligned} y & =\frac{4}{2+\sin x}-1 \\ \therefore\quad y\left(\frac{\pi}{2}\right) & =\frac{4}{2+\sin \frac{\pi}{2}}-1=\frac{4}{2+1}-1 \\ & =\frac{4}{3}-1=\frac{1}{3} \end{aligned}$$
If $y(t)$ is a solution of $(1+t) \frac{d y}{d t}-t y=1$ and $y(0)=-1$, then show that $y(1)=-\frac{1}{2}$.
$$\begin{aligned} &\text { Given that, }\\ &(1+t) \frac{d y}{d t}-t y=1\\ &\Rightarrow \quad \frac{d y}{d t}-\left(\frac{t}{1+t}\right) y=\frac{1}{1+t} \end{aligned}$$
which is a linear differential equation.
On comparing it with $\frac{d y}{d t}+P y=Q$, we get
$$\begin{aligned} P & =-\left(\frac{t}{1+t}\right), Q=\frac{1}{1+t} \\ I F & =e^{-\int \frac{t}{1+t} d t}=e^{-\int\left(1-\frac{1}{1+t}\right) d t=e^{-[t-\log (1+t)]}} \\ & =e^{-t} \cdot e^{\log (1+t)} \\ & =e^{-t}(1+t) \end{aligned}$$
The general solution is
$$\begin{aligned} y(t) \cdot \frac{(1+t)}{e^t} & =\int \frac{(1+t) \cdot e^{-t}}{(1+t)} d t+C \\ \Rightarrow\quad y(t) & =\frac{e^{-t}}{(-1)} \cdot \frac{e^t}{1+t}+C^{\prime}, \text { where } C^{\prime}=\frac{C e^t}{1+t} \\ \Rightarrow\quad y(t) & =-\frac{1}{1+t}+C^{\prime} \end{aligned}$$
When $t=0$ and $y=-1$, then
$$\begin{aligned} -1 & =-1+C^{\prime} \Rightarrow C^{\prime}=0 \\ y(t) & =-\frac{1}{1+t} \Rightarrow y(1)=-\frac{1}{2} \end{aligned}$$
Form the differential equation having $y=\left(\sin ^{-1} x\right)^2+A \cos ^{-1} x+B$, where $A$ and $B$ are arbitrary constants, as its general solution.
Given that, $$y=\left(\sin ^{-1} x\right)^2+A \cos ^{-1} x+B$$
On differentiating w.r.t. $x$, we get
$$\begin{aligned} \frac{d y}{d x} & =\frac{2 \sin ^{-1} x}{\sqrt{1-x^2}}+\frac{(-A)}{\sqrt{1-x^2}} \\ \Rightarrow \quad \sqrt{1-x^2} \frac{d y}{d x} & =2 \sin ^{-1} x-A \end{aligned}$$
$$\begin{aligned} &\text { Again, differentiating w.r.t. } x \text {, we get }\\ &\sqrt{1-x^2} \frac{d^2 y}{d x^2}+\frac{d y}{d x} \cdot \frac{-2 x}{2 \sqrt{1+x^2}}=\frac{2}{\sqrt{1-x^2}} \end{aligned}$$
$$\begin{array}{lr} \Rightarrow & \left(1-x^2\right) \frac{d^2 y}{d x^2}-\frac{x}{\sqrt{1-x^2}} \cdot \sqrt{1-x^2} \frac{d y}{d x}=2 \\ \Rightarrow & \left(1-x^2\right) \frac{d^2 y}{d x^2}-x \frac{d y}{d x}=2 \\ \Rightarrow & \left(1-x^2\right) \frac{d^2 y}{d x^2}-x \frac{d y}{d x}-2=0 \end{array}$$
which is the required differential equation.