Symbolic differentiation [closed]

I have two symbolic differential equations and I want to used them in another equation as follows:

eq1 = Dt[Ai] == mt*δfm + 2*Ω^2;
eq2 = Dt[Ri] == h*δmm + 2*Ω^2;
ya = Ai*Ri;
Dt[ya]


Ri Dt[Ai] + Ai Dt[Ri]

Instead, I want output that inserts Dt[Ai] and Dt[Ri] and gives the simplified form.

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Michael E2 Jan 7 '16 at 1:23
• Do you not get error messages from your code? – Michael E2 Jan 7 '16 at 1:24
• Perhaps ya = Ai Ri; Simplify[Dt[ya] /. {Dt[Ai]->h δfm + 2 Ω^2, Dt[Ri]->mt δmm + 2 Ω^2}] – Bill Jan 7 '16 at 1:44
• Hi i mistakenly posted the wrong equations. I have updated the post. – aly Jan 7 '16 at 2:18
• @bill & Michael. Thanks for your quick answer. I want a solution with the way i have defined because i will need those differential equation several times in many equations and following the routine you recommended will be bulky when used every time. – aly Jan 7 '16 at 2:30

If you want teach Mathematica to make the substitution automatically, you should define special evaluation rules for Dt[Ai] and Dt[Ri] with UpSet (^=).

Dt[Ai] ^= mt*\[Delta]fm + 2*\[CapitalOmega]^2;
Dt[Ri] ^= h*\[Delta]mm + 2*\[CapitalOmega]^2;
ya = Ai Ri;
Dt[ya]


Ri (mt δfm + 2 Ω^2) + Ai (h δmm + 2 Ω^2)

You can also replace the head of your equations, turning them temporarily into Rule objects for the purpose of the substitution.

eq1 = Dt[Ai] == mt*δfm + 2*Ω^2;
eq2 = Dt[Ri] == h*δmm + 2*Ω^2;
ya = Ai*Ri;
Dt[ya]

Dt[ya] /. Rule @@@ {eq1, eq2}

(* Ri Dt[Ai] + Ai Dt[Ri] *)

(* Ri (mt δfm + 2 Ω^2) + Ai (h δmm + 2 Ω^2) *)


I got the solution that satisfies me:

eq1 = Dt[Ai] == mt*δfm + 2*Ω^2
eq2 = Dt[Ri] == h*δmm + 2*Ω^2;
ya = Ai*Ri;

result = Simplify[Dt[ya] /.{Dt[Ai] -> eq1, Dt[Ri] -> eq2}]


I am satisfied with the solution but if you have a better solution, please share. Thanks to Bill as I derived the solution following his answer.

• This gives result in form of __ == __ == __, is this really what you expect? – Kuba Jan 8 '16 at 7:59
• It gives me the correct results – aly Jan 30 '16 at 13:38