According to the question,
Sum of the coordinates of any point (x,y) on the curve
=Magnitude of the slope of the tangent to the curve+5
(because of exceeds)
Here the slope is taken as dxdy with its sign (on the curve found below, dxdy<0, so a literal "magnitude" reading would not give a solution), so
⇒x+y=dxdy+5
⇒dxdy+5=x+y
⇒dxdy−y=x−5
Linear Differential Equation
Comparing with
dxdy+Py=Q,
we have
P=−1,Q=x−5
Integrating Factor
∫Pdx=∫(−1)dx=−x
I.F.=e∫Pdx=e−x
General Solution
y(I.F.)=∫Q(I.F.)dx+c
⇒ye−x=∫(x−5)e−xdx+c
Applying Integration by Parts
Let
I=(x−5),II=e−x
Using the product rule,
∫I⋅IIdx=I∫IIdx−∫(dxdI∫IIdx)dx
=(x−5)(−1e−x)−∫1(−1e−x)dx
=−(x−5)e−x+∫e−xdx
=−(x−5)e−x−e−x
Substituting Back
ye−x=−(x−5)e−x−e−x+c
Dividing every term by e−x,
y=−(x−5)−1+cex
⇒y=−x+4+cex(i)
or
x+y=4+cex
To Find c
Given: the curve passes through the point (0,2).
Putting x=0 and y=2 in (i),
2=4+ce0
2=4+c
⇒c=−2
Equation of the Required Curve
Putting c=−2 in (i),
x+y=4−2ex
or equivalently,
y=4−x−2ex
which is the required equation of the curve.