# test solution for differential equation, return 0 is true; #test(sol_ and sol2_, eq_, eq2_):= chop(test(sol+sol2,eq,y)) and chop(test(sol1+sol2,eq2,y)); test(xx_=a_,yy_=b_, eq1_=eq1r_,eq2_=eq2r_):= chop(n(simplify(expand(replace(replace(tods(eq1-eq1r),xx,a),yy,b))))), chop(n(simplify(expand(replace(replace(tods(eq2-eq2r),xx,a),yy,b))))); 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(replace(tods(eq),y,sol))))); 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_);