How should I do partial derivatives in Maple in a symbolic way?

393 Views Asked by At

I want to calculate the partial derivatives of the function $A(x,y)$. For example, I want to use Maple to calculate $\frac{\partial^2}{\partial x\partial y}\left(K\cdot x\cdot A(x,y) \right)$ where $K$ is some constant. Here the function $A(x,y)$ is not defined explicitly and so I expect to see terms like $\frac{\partial^2}{\partial x\partial y}A(x,y)$ in the answer.

I used the following Maple code to calculate

D[1,1] (K * x * A) (x,y) assuming K::constants

However, Maple will treat $x$ in $K \cdot x \cdot A$ also as a function. How should I tell Maple that $x$ is a variable that I want to take derivative with?

1

There are 1 best solutions below

0
On BEST ANSWER

Judging by the partial result you're expecting $$ \frac{\partial^2}{\partial x\partial y}A(x,y), $$ I'm assuming you're looking to make use of $D[1,2]$ (refering to the first and second variable). We can define $f$ as $$f:=(x,y)\to K\cdot x\cdot A(x,y).$$ From here you get the desired output $$D[1,2](f)(x,y) = K\cdot \frac{\partial}{\partial y}A(x,y) + K\cdot x\cdot \frac{\partial^2}{\partial x\partial y}A(x,y).$$ You can at any point convert to partials with $\mathrm{convert}(\%,\mathrm{diff})$.