Let \(F(x,y)\) be the curve and let \((x,y)\) be a point on the curve.The slope of the tangent to the curve at \((x,y)\) is \(\frac{dy}{dx}\).
According to the given information:
\(\frac{dy}{dx}+5=x+y\)
\(⇒\frac{dy}{dx}-y=x-5\)
This is a linear differential equation of the form:
\(\frac{dy}{dx}+py=Q\)(where p=-1 and Q=-5)
Now,\(I.F.=_e∫p\,dx=_e∫(-1)dx=e^{-x}.\)
The general equation of the curve is given by the relation,
\(y(I.F.)=∫(Q\times I.F.)dx+C\)
\(⇒y.e^{-x}=∫(x-5)e^{-x}dx+C...(1)\)
Now,\(∫(x-5)e^{-x}dx=(x-5)∫e^{-x}dx-∫[\frac{d}{dx}(x-5).∫e^{-x}dx]dx.\)
\(=(x-5)(-e^{-x})-∫(-e^{-x})dx\)
\(=(5-x)e^{-x}+(-e^{-x})\)
\((4-x)e^{-x}\)
Therefore,equation(1)becomes:
\(y\,e^{-x}=(4-x)e^{-x}+C\)
\(⇒y=4-x+Ce^x\)
\(⇒x+y-4=Ce^x...(2)\)
The curve passes through point(0,2).
Therefore,equatiuon(2)becomes:
\(0+2-4=Ceº\)
\(⇒-2=C\)
\(⇒C=-2\)
Substituting C=-2 in equation(2),we get:
\(x+y-4=-2e^x\)
\(⇒y=4-x-2e^x\)
This is the required equation of the curve.