Diff and Taylor to return expressions in terms of partial derivatives?
Subject: Diff and Taylor to return expressions in terms of partial derivatives?
From: Mike Valenzuela
Date: Tue, 5 Mar 2013 14:01:51 -0700
Hello,
I will start by providing the context of my question. I was playing around
with Multiple-scale analysis (
http://en.wikipedia.org/wiki/Multiple-scale_analysis), and a common trick I
find in a couple of text books involve the following. See (C. C. Lin and L.
A. Segel, *Mathematics Applied to Deterministic Problems in the Natural
Sciences*, Chapter 11: Three Techniques Applied to the Pendulum) for the
below example:
(1) Introduce a slow variable: tau=epsilon*t
(2) Introduce the assumption that: f(t, tau, epsilon) = f[0](t, tau) +
epsilon*f[1](t, tau) + epsilon^2*f[2](t,tau) + ...
In the textbook f[i] --> f superscript i,
This is like a Taylor series expansion, except that the variable t is never
multiplied on the outside to avoid secular terms
(3) df[0]/dt = partial(f[0], t) * partial(t,t) + partial(f[0], tau) *
partial(tau, t) = f[0]_1 + epsilon*f[0]_2
Where the underscore denotes partial with respect to the ith argument
(4) Thus
df/dt = f[0]_1 + epsilon*(f[0]_2 + f[1]_1) + epsilon^2*(f[1]_2 + f[2]_1) +
epsilon^3*(f[2]_2 + f[3]_1) + ...
d^2f/dt^2 = f[0]_11 + epsilon*(f[0]_12 + f[0]_21 + f[1]_11) +
epsilon^2*(f[0]_22 + f[1]_12 + f[1]_21 + f[2]_11) + ...
So the question. How can I tell Maxima to replicate the above results
easily in Maxima?
Is there some method like def_diff, which would allow me to specify the
first derivative and would produce the correct higher order derivatives via
the chain rule?
I think the basic approach would be to configure Maxima to provide
derivatives and Taylor expansions using partial derivatives.
I tried deftaylor, but it does not appear to like multivariate definitions.
I tried using depends(tau, [t, epsilon]), but I couldn't get the same
results as above.
I tried using taylor( f(t,tau,epsilon), [t, tau], 0, 2), but I couldn't
figure out how to make Maxima avoid the secular terms.
I think it would be useful to have partial derivative expansions as an
option in Taylor and Diff as these would be nice in other applications as
well. A few that come to mind include Calculus of Variations and the
derivation of the Runge Kutta methods.
Thanks in advance for any advice in simplifying this process.