How do I convert equations from cartesian to spherical/cylindrical?

1000 Views Asked by At

I understand the relations between cartesian and cylindrical and spherical respectively. I find no difficulty in transitioning between coordinates, but I have a harder time figuring out how I can convert functions from cartesian to spherical/cylindrical.

Given a multivariable function, let's say $$f(x,y)=x^2+2xy+y^2,$$ how do I convert this equation to the spherical and cylindrical?

Is there a given method I can use that will always produce a correct result? Perhaps I have not given this enough thought, but I'd like to wrap my head around this and given neither our lecturer or the literature gives any though on the matter I find myself rather lost.

1

There are 1 best solutions below

1
On BEST ANSWER

First of all, you have a function of two variables, $f(x,y)$, thus you might want to use polar coordinates instead of cylindrical/spherical coordinates.

You can use these formulas to convert from cartesian coordinates to polar coordinates: $$\begin{aligned}x&=r\cos\theta\\y&=r\sin\theta.\end{aligned}$$

Substituting into the given function $f(x,y)=x^2+2xy+y^2$ yields:$$\begin{aligned}f(r,\theta)&=r^2\cos^2\theta+2(r\cos\theta)(r\sin\theta)+r^2\sin^2\theta\\&=r^2(\cos^2\theta+\sin^2\theta)+2r^2\cos\theta\sin\theta\\&=r^2(1+2\cos\theta\sin\theta).\end{aligned}$$

Notice that the function $f$ now depends on $(r,\theta)$ instead of $(x,y)$.

For a function of three variables $f(x,y,z)$ one can use cylindrical coordinates: $$\begin{aligned}x&=r\cos\theta\\y&=r\sin\theta\\z&=z\end{aligned}$$ or spherical coordinates: $$\begin{aligned}x&=r\sin\theta\cos\varphi\\y&=r\sin\theta\sin\varphi\\z&=r\cos\theta.\end{aligned}$$ Hope this helps. :)