MATLAB: Differentiating algebraic equation fractions

differential equationsExtended Symbolic Math ToolboxmathematicsMATLAB

Hi guys, have a test coming up and i will be able to use matlab.
How do i differentiate algebraic equations such as fractions, in real life we will use the quotient rule, but how do i do it using matlab?
Ex: d/dx ((-x^2-x)/(x+2)*(x+3))
What will i enter into matlab for it to be differentiated?

Best Answer

syms x;
simplify(diff(@(x)((-x^2-x)/(x+2)*(x+3)),x))