# test(solution, eq) for algebra and differential equation, return 0 is true; test(sol_,eq_):= if(isconstant(sol) and hasnot(eq,y),chop(n(replace(eq,x,sol))), test(sol,eq,y)); test(sol_,eql_=eqr_):= test(sol,eql-eqr); test(sol_ and sol2_,eq_):= test(sol,eq) and test(sol2,eq); test(sol_ and sol2_,eq_=eqr_):= test(sol,eq-eqr) and test(sol2,eq-eqr); test(sol_ and sol2_ and sol3_,eq_):= test(sol,eq) and test(sol2,eq) and test(sol3,eq); test(sol_ and sol2_ and sol3_ and sol4_,eq_):= test(sol,eq) and test(sol2,eq) and test(sol3,eq) and test(sol4,eq); test(sol_=sol2_,eq_):= test(solve(replace(sol=sol2,C_1,1),y),eq); test(sol_=sol2_,eql_=eqr_):= test(solve(replace(sol-sol2,C_1,1),y),eql-eqr); test(sol_=x_,y(n_,x_)=eqr_):= n(expand(d(sol,y,n)-replace(1/eqr,x,sol))); test(sol_=x,y'=eqr_):= n(expand(d(sol,y)-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_,ds(y_,x_,p_)+eqr_):= n(expand(d(sol,y,p)+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( ( (simplify(n(expand(simplify( replace(tods(eq),y,n(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(expand(n(simplify(replace(replace(tods(eq1-eq1r),xx,n(a)),yy,n(b)))))) and chop(expand(n(simplify(replace(replace(tods(eq2-eq2r),xx,n(a)),yy,n(b))))));