Solution:
Key idea: The equation is linear in x when we treat x as the dependent variable: dydx+P(y)x=Q(y). The integrating factor is e∫Pdy, and the solution is x×I.F.=∫Q×I.F.dy+C.
Step 1 — Write the equation in standard form.
We divide both sides by (1+y2)dy.
dydx=1+y2tan−1y−x
We move the x term to the left.
dydx+1+y21x=1+y2tan−1y
Step 2 — Find the integrating factor.
We use ∫1+y2dy=tan−1y.
I.F.=etan−1y
Step 3 — Write the solution as an integral.
We multiply Q by the integrating factor.
xetan−1y=∫1+y2tan−1yetan−1ydy
Step 4 — Evaluate the integral.
We put t=tan−1y, so dt=1+y2dy, and the integral becomes ∫tetdt. We integrate by parts with t as the first function.
∫tetdt=tet−∫etdt
∫tetdt=(t−1)et+C
Step 5 — Write the solution in x and y.
We put back t=tan−1y.
xetan−1y=(tan−1y−1)etan−1y+C
We divide both sides by etan−1y.
x=tan−1y−1+Ce−tan−1y
Therefore, the general solution is x=tan−1y−1+Ce−tan−1y, where C is an arbitrary constant.