Differentiation - MATLAB & Simulink
www.mathworks.com › help › symbolicYou can get the same result by taking the derivative twice: diff (diff (g)) ans = -2*exp (x)*sin (x) In this example, MATLAB ® software automatically simplifies the answer. However, in some cases, MATLAB might not simplify an answer, in which case you can use the simplify command. For an example of such simplification, see More Examples.