# test solution for differential equation, return 0 is true; test(sol_,eq_):= test(sol,eq,y); test(sol_,eql_=eqr_):= test(sol,eql-eqr,y); test(sol_ and sol2_,eq_):= test(sol,eq,y) and test(sol2,eq,y); test(sol_ and sol2_,eq_=eqr_):= test(sol,eq-eqr,y) and test(sol2,eq-eqr,y); test(sol_ and sol2_ and sol3_,eq_):= test(sol,eq,y) and test(sol2,eq,y) and test(sol3,eq,y); test(sol_ and sol2_ and sol3_ and sol4_,eq_):= test(sol,eq,y) and test(sol2,eq,y) and test(sol3,eq,y) and test(sol4,eq,y); test(sol_=sol2_,eq_):= test(solve(replace(sol=sol2,C_1,1),y),eq,y); test(sol_=sol2_,eql_=eqr_):= test(solve(replace(sol-sol2,C_1,1),y),eql-eqr,y); test(sol_=x_,y(n_,x_)+eqr_):= n(expand(d(sol,y,n)+replace(1/eqr,x,sol))); test(sol_=x_,y(n_,x_)=eqr_):= n(expand(d(sol,y,n)-replace(1/eqr,x,sol))); test(sol_=x_,ds(y_,x_)=eqr_):= n(expand(d(sol,y)-replace(1/eqr,x,sol))); test(sol_=x,y'=eqr_):= n(expand(d(sol,y)-replace(1/eqr,x,sol))); test(sol_,int(y(tt_),t_,a_,b_)=eqr_):= block(p(x)=sol,expand(int(p(tt),t,a,b)-eqr)); test(sol_,eq_,y_):= chop(n(simplify(expand(simplify(expand((replace(tods(eq),y,replace(sol,C_1,1))))))))); test(sol_,eql_=eqr_,y_):= test(sol,eql-eqr,y); test(xx_=a_ and yy_=b_,eq1_=eq1r_,eq2_=eq2r_):= test(xx=a,yy=b,eq1=eq1r,eq2=eq2r); test(xx_=a_,yy_=b_,eq1_=eq1r_,eq2_=eq2r_):= chop(n(simplify(expand(simplify(replace(replace(tods(eq1-eq1r),xx,a),yy,b)))))) and chop(n(simplify(expand(simplify(replace(replace(tods(eq2-eq2r),xx,a),yy,b))))));