Tuesday, June 11, 2013

an experiment…

I’ve been wanting to get LaTeX working on this blog for at least a few months now. When I first tried it, I had the impression that it would be all sorts of convoluted. Fortunately, I just found another blog post with a variety of links on how to make it simple, so I’m going to try some of them out. (See the final remark at the bottom, plus the comments, for some observations on how well this works.)

Here is what prompted my initial crise de foi regarding the marriage of LaTeX and Blogger. This past spring, I taught an “advanced calculus” course, which amounted to an introduction to (embedded) manifolds. I was a TA for this class, twice, as a graduate student, and it has some of my favorite calculus material—the kind that makes you realize what a breathtaking endeavor it is. One of the first big revelations is the nature of the derivative. I love this part of the class, and I wanted to share it.

When we first teach the derivative, we teach it as a number. We have to. It’s hard to imagine conveying anything more abstract about it when the definition already involves tangents, limits, possibly infinitesimals, and we just want to instill some level of understanding. But the purpose of the derivative—indeed, the philosophy behind all of differential calculus—is to take a curvy object and make it straight. Since we apply it to functions, the result should be a straightened function, i.e., a linear function. A linear function from $\mathbb{R}^m$ to $\mathbb{R}^n$ may be encoded by an $n \times m$ matrix. That's often convenient, but not always. Here’s a simple example that shows that sometimes it’s best to avoid matrices.

First, the matrix-free definition of the derivative. Let $U \subseteq \mathbb{R}^m$ be an open set, and let $f : U \to \mathbb{R}^n$ be a function. Then $f$ is differentiable at $\mathbf{x} \in U$ if there exists a linear function $L : \mathbb{R}^m \to \mathbb{R}^n$ such that \[ \lim_{|\mathbf{h}|\to0} \frac{|f(\mathbf{x}+\mathbf{h}) - f(\mathbf{x}) - L(\mathbf{h})|}{|\mathbf{h}|} = 0. \] If such a function $L$ exists, then it is unique, and we write $Df(\mathbf{x}) = L$.

Now consider the set of $n \times n$ matrices, and identify this set with $\mathbb{R}^{n^2}$. Define $S : \mathbb{R}^{n^2} \to \mathbb{R}^{n^2}$ by $S(A) = A^2$. If we were to write this function out in coordinates, we would see that all of the entries are polynomials, and so it is differentiable. What is its derivative at a point $A$? Note that the derivative must be a linear map from $\mathbb{R}^{n^2}$ to itself, so writing out a matrix would be fairly taxing.

Instead, we can get an idea of what the derivative should be by adding a variable matrix $H$ (presumed to be small) to the matrix $A$ and seeing the result of the function: $S(A+H) = (A+H)^2 = A^2 + AH + HA + H^2$. The part of this expression that “looks linear in $H$” is the middle two terms. Indeed, if we set $L(H) = AH + HA$, then we find \[ \lim_{|H|\to0} \frac{|(A+H)^2 - A^2 - (AH + HA)|}{|H|} = \lim_{|H|\to0} \frac{|H|^2}{|H|} = 0. \] Ah-ha! The derivative of the squaring function $S$ at $A$ is $DS(A) : H \mapsto AH + HA$! I still find this computation incredibly insightful.

What happens when $n = 1$? Then our matrix $A$ is $1 \times 1$, so it’s just a number, say $a$. The squaring map is $S(a) = a^2$, and the derivative of this map sends $h$ to $ah + ha = ah + ah = 2ah$. In the one-variable setting, we find $S'(a) = 2a$, and so this perspective on the derivative in terms of linear maps has reaffirmed the geometric meaning of the ordinary derivative: it describes the amount by which the range variable changes, infinitesimally, when the domain variable is altered infinitesimally.


Remarks:

5 comments:

Professor Hitchman's Alter Ego said...

I find that MathJax and Blogger are still unhappy about working together, too.

a hack I use is to sneak in MathJax as part of embedding SageCells. I have javascript in my header to allow these, and it includes a call to MathJax. Somehow, this works better. Even if I don't have a sage cell in a particular post, the math comes out good.

Joshua Bowman said...

T.J.—

What kinds of problems have you come across in using MathJax? Does working through SageCells increase the time to render the math? It's an interesting idea; I'll look into trying something like that.

Christian Lawson-Perfect said...

I have a feeling that the sage cell trick works because it takes longer to start loading mathjax, so the post content has loaded by then. Maybe sticking in a second's delay before inserting the mathjax script into the page would work just as well. That still wouldn't get it to typeset when you click on another post, though.
I've basically given up on blogger+mathjax. Google really doesn't want it to happen.

Professor Hitchman's Alter Ego said...

The last time Google changed the "under the hood" bits of Blogger, things got all wonky. sometimes it would display, sometimes not. It never worked properly with the dynamic views, even before the update.

Now, it works just fine. Rendering math is just a bit slower than a functioning MathJax-only setup would be.

But I like having the functionality of working Sage Cells, so I don't mind a small speed tradeoff. and you don't need a cell in every post. Just slap the code in your header.

Joshua Bowman said...

It is disheartening how little interest Google has shown in making LaTeX typesetting available. (After the fate of Google Reader, should we be concerned about what might happen to Blogger?) Right now, my blog isn't math-heavy enough, nor does it get enough traffic, for me to feel like transporting the whole thing to another host would be worth it. I can manage the hacks for the moment, but seeing how much y'all and others have struggled in this context makes me think change is inevitable.