36. $(1 + x^{2})\frac{dy}{dx}+2xy = f(x); y(0)=0,$\n$f(x)=\begin{cases}x, & 0leq xlt1\\ -x, & xgeq1end{cases}$

36. $(1 + x^{2})\frac{dy}{dx}+2xy = f(x); y(0)=0,$\n$f(x)=\begin{cases}x, & 0leq xlt1\\ -x, & xgeq1end{cases}$
Answer
Explanation:
Step1: Rewrite the ODE
The given first - order linear ODE ((1 + x^{2})\frac{dy}{dx}+2xy = f(x)) can be rewritten as (\frac{dy}{dx}+\frac{2x}{1 + x^{2}}y=\frac{f(x)}{1 + x^{2}}). The integrating factor is (e^{\int\frac{2x}{1 + x^{2}}dx}). Let (u = 1 + x^{2}), then (du=2xdx), and (\int\frac{2x}{1 + x^{2}}dx=\ln(1 + x^{2})), so the integrating factor is (1 + x^{2}).
Step2: Solve for (y) on (0\leq x<1)
The general solution of the ODE is (y(1 + x^{2})=\int f(x)dx+C). For (0\leq x<1), (f(x)=x), so (y(1 + x^{2})=\int xdx+C=\frac{x^{2}}{2}+C). Using the initial condition (y(0) = 0), when (x = 0,y = 0), we get (0=\frac{0^{2}}{2}+C), so (C = 0). Then (y=\frac{x^{2}}{2(1 + x^{2})}) for (0\leq x<1).
Step3: Solve for (y) on (x\geq1)
We first need to find the value of (y) at (x = 1). When (x = 1), (y=\frac{1^{2}}{2(1 + 1^{2})}=\frac{1}{4}). For (x\geq1), (f(x)=-x), and the ODE gives (y(1 + x^{2})=\int - xdx+C=-\frac{x^{2}}{2}+C). Substitute (x = 1,y=\frac{1}{4}) into (y(1 + x^{2})=-\frac{x^{2}}{2}+C), we have (\frac{1}{4}(1 + 1)=-\frac{1}{2}+C), which gives (C = 1). So (y=\frac{1-\frac{x^{2}}{2}}{1 + x^{2}}=\frac{2 - x^{2}}{2(1 + x^{2})}) for (x\geq1).
Answer:
(y=\begin{cases}\frac{x^{2}}{2(1 + x^{2})},&0\leq x<1\\frac{2 - x^{2}}{2(1 + x^{2})},&x\geq1\end{cases})