What is the output of the following code? [code]syms y; dsolve('y*diff(y)+5=x*exp(3)','y')[/code]

What is the output of the following code?
Code:
syms y; dsolve('y*diff(y)+5=x*exp(3)','y')
A. Error
B. C + (x*(x*exp(3) – 10))/2
C. Cannot be determined
D. 0
 
Answer: a
Explanation: Our second argument in the dsolve() command is wrong. If we provide a second argument, it should specify the independent variable. But here we are differentiating y and specifying y as the independent variable. If we write dsolve(‘y*diff(y)+5=x*exp(3)’,’x’), the output would be C + (x*(x*exp(3) – 10))/2.
 

Tìm kiếm

Back
Top