求教 matlab求导问题。

我想求(x+y)^2对x的导数
syms x
diff((x+y)^2)
得出的结果
ans =
2*x + 2*y
为什么把y的也求导了呢。。只想把y看做普通常数变量啊
大神怎么解决这个问题呢

 Respuesta aceptada

pecik
pecik el 20 de Nov. de 2022

0 votos

(x+y)^2 = x^2 + 2*x*y + y^2
把y看作普通常数,求导就是 2*x + 2*y 啊
你希望得到的是什么样的结果呢?

Más respuestas (0)

Categorías

Más información sobre 启动和关闭 en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Nov. de 2022

Respondida:

el 20 de Nov. de 2022

Community Treasure Hunt

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

Start Hunting!