How to define second derivative in symbolic

4 views (last 30 days)
Anas Zh
Anas Zh on 7 Apr 2022
Commented: Star Strider on 7 Apr 2022
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.

Accepted Answer

Star Strider
Star Strider on 7 Apr 2022
Use the symbolic diff function —
syms A
r(A) = cos(A)
r(A) = 
D1r = diff(r)
D1r(A) = 
D2r = diff(r,2)
D2r(A) = 

Sign in to comment.

More Answers (1)

Mohammed Hamaidi
Mohammed Hamaidi on 7 Apr 2022
dr/dA = -sin(A)*(dA/d)
d²r/dA² = -cos(A)*(dA/d)^2-sin(A)*d²A/d²

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!

Translated by