# Example to show the syntax: # # _Envdiffopdomain := [Dx,x]: # (see help page of DEtools[mult] for this) # # L1 := x^2*Dx^2-4*x^6+4*x^4-3/4; # L2 := Dx^2 + 2-10*x+4*x^2-4*x^4; # equiv(L1,L2); # --> Gives the map from the solution space of L1 to the solution space # of L2, showing effectively that solving L1 is equivalent to solving L2. # To get the inverse map, call equiv(L2,L1). # Checks if M2 can be solved in terms of M1, and if so, finds the map. equiv:=proc(M1,M2,d) local DF,x,T1,L1,T2,L2,C0,D0,S,C1,D1,dd,v,v1; if nargs>2 then if type(d,list(name)) and nops(d)=2 then _Envdiffopdomain:=d elif type(d,function) then _Envdiffopdomain:=[DF,x]; return `DEtools/diffop2de`(procname(seq( `DEtools/de2diffop`(args[i],d),i=1..2)),d) else error "wrong number or type of arguments" fi elif not assigned(_Envdiffopdomain) then error "domain is not assigned" fi; DF,x := op(_Envdiffopdomain); if not type([M1,M2],list(polynom(ratpoly(anything,x),DF))) then error "wrong arguments or dependent variable not specified" elif degree(M1,DF)<>2 or degree(M2,DF)<>2 then error "case not handled yet" fi; T1:=Normalizer(coeff(M1,DF,1)/coeff(M1,DF,2)/2); L1:=`DEtools/symmetric_product`(M1,DF-T1); T2:=Normalizer(coeff(M2,DF,1)/coeff(M2,DF,2)/2); L2:=`DEtools/symmetric_product`(M2,DF-T2); C0:=Normalizer(coeff(L1,DF,0)/coeff(L1,DF,2)); D0:=Normalizer(coeff(L2,DF,0)/coeff(L2,DF,2)-C0); if D0=0 then S:=1 else C1:=Normalizer(diff(C0,x)); D1:=Normalizer(diff(D0,x)); dd:=Normalizer(D1/D0); v:=map(Normalizer,[2*diff(C1,x)+diff(D1,x)-2*dd*C1-D1*dd+D0^2, 6*C1+D1-4*dd*C0, 2*(D0+2*C0), -dd, 1]); v:=`DEtools/Expsols`(v,0,x,`use Int`,`no algext`,radical,denom,2); if nops(v)=0 then return 0 elif nops(v)>1 then userinfo(1,'dsolve',"input is reducible"); return 0 else v:=v[1]; v1:=Normalizer(diff(v,x)); S:=collect(v*DF + (diff(v1,x,x)+(4*C0+5*D0)*v1+v*(2*C1+D1))/2/D0-2*v1 ,[exp,DF],Normalizer) fi fi; S:=combine(collect(exp(Int(-T2,x))*`DEtools/mult`( S,exp(Int(T1,x))),[exp,DF],Normalizer),exp); v:=seq(`if`(op(0,i)=exp,i,NULL),i=indets(S,function)); if nops([v])<>1 then error "exp not collected" fi; collect(subs(v=`DEtools/kovacicsols/e_int`(Normalizer( diff(op(v),x)),x),S),DF,Normalizer) end: