# Curvilinear Coordinates

load("linearalgebra")$

## Polar coordinates

Define the transformation for polar -> cartesian.

v: [r*cos(φ),r*sin(φ)];

Differentiate.

D: diff(v);

The dot product yields the square of the scale factor(s).

D . D;

trigsimp(D . D);

for the transformation (r,φ) -> (x,y) one also has the Jacobian matrix J.

J: jacobian(v,[r,φ]);

for (x,y) -> (r,φ), just invert J.

invert(J);

J_inv: trigsimp(invert(J));

Extract the rows of the Jacobian inverse.

first(J_inv);

second(J_inv);

## Spherical coordinates

(r,θ,φ) -> (x,y,z):

w: r*[cos(φ)*sin(θ),sin(φ)*sin(θ),cos(θ)];

JW: jacobian(w,[r,θ,φ]);

invert(JW);

JW_inv: trigsimp(invert(JW));

determinant(JW);

trigsimp(%);

dW: diff(w);

trigsimp(dW . dW);

There was a question whether you could do Laplace transforms in Maxima. The answer is yes:

laplace(sin(t),t,s);

ilt(%o20,s,t);