# How about using a second order DE
# Let's use the original de: y" + 3 y' + 2y = f
f = x
pretty_print("This is the DE: y'' + 3 y' + 2y = %s"%str(f))
y = function('y')(x)
DE = diff(y,x,2) + 3*diff(y,x,1) + 2*y - f # Notice that we have put this in the form y' - f = 0
soln = desolve( DE, y ) # So this is the answer we are looking for
pretty_print("and this is the solution y(x) = ",soln)
# So, we take the derivative of this answer and plug back into the DE and simplify
solnp = diff(soln,x,1)
solnpp = diff(soln,x,2)
yprime_minus_f = solnpp+3*solnp+2*soln - f
show("So, y' - f = ",yprime_minus_f,"=",yprime_minus_f.simplify_full())