How to define second derivative in symbolic

AA, I have a project to derive some equations that defined in symbolic variables. For example, r= cos(A), I want the symbolic system show me a result that dr/dA = -sin(A)*(dA/d) as A has derivatives values dA/d and so far for d²A/d² If I want the second derivative of r.

 Akzeptierte Antwort

Use the symbolic diff function —
syms A
r(A) = cos(A)
r(A) = 
D1r = diff(r)
D1r(A) = 
D2r = diff(r,2)
D2r(A) = 
.

6 Kommentare

Anas Zh
Anas Zh am 7 Apr. 2022
Where is dA/d?
Here you go —
syms A(t)
r = cos(A)
r(t) = 
D1r = diff(r)
D1r(t) = 
D2r = diff(r,2)
D2r(t) = 
Here, A has to be defined as a function of something, otherwise it is treated as a constant. So I made it a function of t.
.
That is it
Thank you.
Anas Zh
Anas Zh am 7 Apr. 2022
Thank you a lot
As always, my pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Mohammed Hamaidi
Mohammed Hamaidi am 7 Apr. 2022

0 Stimmen

dr/dA = -sin(A)*(dA/d)
d²r/dA² = -cos(A)*(dA/d)^2-sin(A)*d²A/d²

3 Kommentare

Anas Zh
Anas Zh am 7 Apr. 2022
How can I let MATLAB symbolic shows this result as finally, I will substitute the derivative
What is A?
Any variable, it doesn't matter

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by