Chapter 16. Anti-gradients
This chapter is actually usually not taught until much later in 18.02, in Part India. However, I’m going to stick it in here, while your brain hasn’t been infested with integrals yet, since it’s a standalone question. However, if you prefer to follow 18.02 more strictly, you could skip this chapter for now and come back a month or two later once you actually need to know how to do it.
The goal of this chapter is to do backwards:
§16.1 [TEXT] There’s still everywhere
I’ll note right away that you still have the from 18.01. To elaborate, you might remember in 18.01 that for for any constant , and we usually just ignore the because it does nothing.
For 18.02 we’ll do the same thing. For example, if and , then they have the same gradient:
However, we just agree to not care about the constant; if asked to find a potential function, and is any acceptable answer, then so is . But there are will be no other answers besides for various .
§16.2 [TEXT] Guessing works pretty well
Sometimes you might be able to just guess , and if so, good for you. See if you can guess the answers to the following ones:
§16.3 [TEXT] Antiderivative method, if you’re promised there is one
- Let denote the gradient function.
- Integrate the given with respect to to get some equation of the form for some function .
- Integrate the given with respect to to get some equation of the form for some function .
- Stitch them together and output a function .
With three variables, it’s similar, but more work.
- Let denote the gradient function.
- Integrate the given with respect to to get some equation of the form for some function .
- Integrate the given with respect to to get some equation of the form for some function .
- Integrate the given with respect to to get some equation of the form for some function .
- Stitch everything together to output .
Let’s do a two-variable example first.
We are given the gradient of a function :
Recover .
Solution. This means:
Integrate and with respect to and :
Stitching these together to get the final expression for as:
for any constant .
We are given the gradient of a function :
Recover .
Solution. This means:
Integrate and with respect to and :
Stitching this together gives
Here’s a three-variable version.
We are given the gradient of a function :
Recover .
Solution. Again, integrate with respect to all three components:
Here again is some function depending only on and ; similarly for and . Now stitch everything together:
§16.4 [TEXT] Actually most of the time no potential function exists
So far this might feel like 18.01 integration beefed up to many variables. But something is actually different. Up until now I’ve picked gradients for which there was an answer.
But most of the time that’s not true: the thing that’s different in 18.02 is that for a randomly written question this task is really impossible. That’s actually a major difference.
Weren’t there impossible integrals in 18.01? Well, it depends on what you mean by “impossible”. For example, a question you won’t see in 18.01 is
which can be translated to “find a function such that ”. The reason you’re not asked this in 18.01 is because, while such a function does exist, it can’t be expressed in a way that makes sense to 18.01 students.
But I mean, you could always cheat and write
The right-hand side really evaluates to some number for every , e.g. if you do numerical analysis , , etc. So there really is some function whose derivative is . It just doesn’t have any good way to write it down. That means, if you tried to solve the question in 18.01 methods, you just eventually run out of methods and ideas to try.
In the 18.02 version, we’re about to see that even simple analogous questions might have answer “no such function exists”. So when you try to solve an impossible anti-gradient question, something really different will happen: rather than running out of methods and ideas, you can follow the usual method and then reach a contradiction.
Determine whether or not there exists a differentiable function such that
Solution. We can imagine we follow through the same method as before. Integration gives
For these to be equal we need , so , which is impossible! What’s going on?
(It’s tempting to write and , but that’s a type error. These new functions and can only depend on their arguments. Indeed, look carefully at everything we wrote for previously: for example, whenever we wrote or , we never allow it to depend on .)
In mathematics there’s a concept of proof by contradiction: if you start from an assumption, and then do some logic and reasoning to reach an impossible conclusion, then the starting assumption was wrong. Here, the starting assumption that there was some function such that . Starting from this assumption we found that there were functions and such that holds for all real numbers and . So our assumption was wrong: there can’t be such function . Not like 18.01 where “ exists but is hard to write down”; the function literally cannot exist.
§16.5 [TEXT] Shortcut for weeding out impossible questions
Okay, so I bet you’re all wondering now, “how can I tell if the question is impossible?”.
Well, one strategy would just be to run the recipe I showed you and see if it works out.
- If you find a function that works, great.
- If you run into a contradiction, well, now you know it’s impossible.
But that’s a lot of work. We’d like a shortcut, and there is one.
The idea is that for functions (for which the partial derivatives are continuous), the partial derivatives commute. What that means, if say is a two-variable function, the following is true:
If and are both continuously differentiable then
If you like notation better, this could also be written as
In other words, if you try to differentiate with respect to , then with respect to , you get the same thing as first then . Sometimes people write this as
This result is at least a bit surprising, and I actually don’t expect you to believe me without seeing some examples. So let’s see some examples:
Let .
- If we differentiate with respect to then to we get .
- Do it the other order: .
Either way we get the same result
Let .
Differentiate with respect to then to :
Do it the other order: Differentiate with respect to then to :
Either way, we get the same result:
Okay, so how about the example we gave earlier?
Determine whether or not there exists a differentiable function such that
Well, if there was such an , and we got a mismatch, then
So via proof by contradiction, no such could exist.
§16.6 [RECIPE] Ruling out the existence of an anti-gradient
As it turns out, this test I described is good enough for 18.02 — it will catch all impossible questions. Specifically, the following theorem is true.
Consider two functions defined on all of , where and are continuously differentiable. Then there exists such that
if and only if
You should think of this as . We’ll see this again much later in Part India, but in different language: “the 2D scalar curl of is zero”.
The 3D version tests all the possible pairs:
Consider three functions defined on all of , where , , are continuously differentiable. Then there exists such that
if and only if all three of the following equations hold:
The above three equations should be remembered as , , . We’ll see this also in Part India again hidden in a different name: “the 3D scalar curl of is zero”. In that part, the given right-hand side will be called called a vector field and the function will be called a potential function for it. But ignore those names for now.
§16.7 [EXER] Exercises
Exercise 16.1. Suppose is a differentiable function and that
for some constants and . Compute the constants and , and determine .