#"This is a linear first order diff. eq. There is a general technique"#
#"for solving this kind of equation. The situation here is simpler"#
#"though."#
#"First search the solution of the homogeneous equation (= the"#
#"same equation with right hand side equal to zero :"#
#{dy}/{dx} + y = 0#
#"This is a linear first order diff. eq. with constant coefficients."#
#"We can solve those with the substitution "y = A e^(rx) :#
#r A e^(rx) + A e^(rx) = 0#
#=> r + 1 = 0" (after dividing through "A e^(rx)")"#
#=> r = -1#
#=> y = A e^-x#
#"Then we search a particular solution of the entire equation."#
#"Here we have an easy situation as we have an easy polynomial"#
#"in the right hand side of the equation."#
#"We try a polynomial of the same degree (degree 1) as solution:"#
#y = x + b#
#=> 1 + x + b = x#
#=> b = -1#
#=> y = x - 1 " is the particular solution."#
#"The entire solution is the sum of the particular solution that we"#
#"have found and the solution to the homogeneous equation :"#
#=> y = A e^-x + x - 1#