#
# xpdf ../../EBook/Elementary_Differential_Equations_10th_Edition.pdf 261 &
#
import sympy
from sympy import *
t, A, B, C = symbols('t A B C')
y = A * t + B + C * t * exp(-t)
pt1 = diff(y, t, 3)
pt2 = diff(y, t, 2)
pt3 = diff(y, t, 1)
pt4 = y
residual = ( pt1 + pt2 + pt3 + pt4 - ( exp(-t) + 4 * t ) )
print(simplify(residual))