Solution:
Key idea: A first-order linear equation can be written as dxdy+Py=Q, where P and Q are functions of x only. Its integrating factor is IF=e∫Pdx. Multiplying the equation by the IF turns the left side into dxd(y⋅IF), so the solution is y⋅IF=∫Q⋅IFdx+c, where c is the arbitrary constant. When the equation is linear in x instead, the same rule is used with x and y interchanged.
Step 1 — Part (i): linear form in x.
Here x appears only to the first power, so we divide by (1+y2)dy.
dydx=1+y2cot−1y+x
dydx−1+y21x=1+y2cot−1y
Step 2 — Part (i): find the IF.
Since dydcot−1y=−1+y21, an integral of P is cot−1y.
IF=ecot−1y
Step 3 — Part (i): solve.
We multiply Q by the IF and put t=cot−1y, so dt=−1+y2dy.
xecot−1y=∫1+y2cot−1yecot−1ydy
xecot−1y=∫−tetdt
Since ∫tetdt=(t−1)et, the integral is (1−t)et.
xecot−1y=(1−cot−1y)ecot−1y+c
Dividing by ecot−1y gives x.
x=1−cot−1y+ce−cot−1y
Step 4 — Part (ii): standard form and IF.
We divide by (1+x2)dx and collect the y term.
dxdy+1+x21y=1+x2tan−1x
An integral of P is tan−1x.
IF=etan−1x
Step 5 — Part (ii): solve.
We multiply Q by the IF and put t=tan−1x, so dt=1+x2dx.
yetan−1x=∫tetdt
yetan−1x=(tan−1x−1)etan−1x+c
Dividing by etan−1x gives y.
y=tan−1x−1+ce−tan−1x
Therefore, (i) xecot−1y=(1−cot−1y)ecot−1y+c, that is, x=1−cot−1y+ce−cot−1y; (ii) y=tan−1x−1+ce−tan−1x.