What will be the output of the following code? syms x;diff(sin(x)\x$^{2}$)

Stasenndb

New member
What will be the output of the following code?
syms x;diff(sin(x)\x$^{2}$)
A. (2*x)/sin(x) – (x$^{2}$*cos(x))/sin(x)$^{2}$
B. cos(x)/x$^{2}$ – (2*sin(x))/x$^{3}$
C. x$^{2}$*cos(x) + 2*x*sin(x)
D. Error
 
Answer: a
Explanation: We observe that sin(x)\x$^{2}$ has a back slash. This, in MATLAB, implies that x$^{2}$ is divided by sin(x). Hence the answer is (2*x)/sin(x) – (x$^{2}$*cos(x))/sin(x)$^{2}$. If it would have been a front slash, the answer would have been cos(x)/x$^{2}$ – (2*sin(x))/x$^{3}$. If there was a ‘*’ sign, the answer would have been ‘x$^{2}$*cos(x) + 2*x*sin(x)’.
 

Tìm kiếm

Back
Top