e-Mathematics > Calculus with wxMaxima
for 2110-004 student.

Partial Derivatives

In Maxima there is no distinction between derivatives and partial derivatives. We can calculate

$\displaystyle \dfrac{\partial^{n+m}}{\partial x^n \partial y^n}f(x,y)
$

by
--> diff(f(x,y),x,n,y,m)
Here we can define the function $ x^3+x^2 y^3 - 2 y^2$ and call it f(x,y) by using the function definition operator ":=". Then differentiate it, and evaluate the derivative at a particular value, for example, $ (x,y) = (2,1)$.
--> f(x,y):= x^3 + x^2*y^3 - 2*y^2
--> f_xy: diff(f(x,y), x, 1, y, 1)
--> f_xy, x=2, y=1
The differential $ dz$ of $ z = f(x,y)$ can be obtained by the same operation "diff" when the variables are not specified
--> diff(f(x,y))
It returns the following output
   (3*x^2*y^2-4*y)*del(y)+(2*x*y^3+3*x^2)*del(x)
where "del(x)" and "del(y)" respectively represent the differential $ dx$ and $ dy$.

Chain rule. When $ x$ and $ y$ in $ z = f(x,y)$ are the functions $ x(s,t)$ and $ y(s,t)$ of $ (s,t)$, Maxima applies the chain rule for the partial derivative $ f_s$ and $ f_t$. Here we have to declare that $ x$ and $ y$ are dependent on the pair $ (s,t)$ of variables.

--> f(x,y) := exp(x)*sin(y)
--> depends([x,y],[s,t])
--> f_s: diff(f(x,y), s)
--> f_t: diff(f(x,y), t)
In order to complete the calculation we have to substitute $ \partial x/\partial s$, $ \partial y/\partial s$, $ \partial x/\partial t$, $ \partial y/\partial t$ by the respective results of partial derivative. Consider $ x = s t^2$ and $ y = s^2 t$ we can complete the partial derivative via chain rule.
--> f_s, diff(x,s)=diff(s*t^2,s), diff(y,s)=diff(s^2*t,s)
--> f_t, diff(x,t)=diff(s*t^2,t), diff(y,t)=diff(s^2*t,t)
However, Maxima can compute the derivative by brute force when we construct the function $ z = g(s,t)$ of $ (s,t)$ at the beginning.
--> z: f(x,y), x=s*t^2, y=s^2*t
--> diff(z, s)
--> diff(z, t)

You may use wxMaxima and complete some of the even-numbered exercises assigned in the class.


© TTU Mathematics