I have been stuck on a sentence in my book for a week. When this happens it tends to mean I am missing something obvious. I can ask a LLM to help. However they tend to just misunderstand my issues or just continually say the wrong thing.

Like in this picture here. This is exactly what I was doing. But I need to sign of dV/dx to be + no - to make it work.

the LLM did that, and then just kept saying it was working. It clearly wasn't.

Anyway it turns out the LLM was making the same mistake I was and the answer is because k.x is a Minkowski metric there is an extra - comes out to fix everything.

I've been banging my head against this for ages.

Also, shout out to #Dirac for overloading the symbols, and using a "Curly A" for the component of A that has curl.
This made it much harder to get the machine to read it, but makes perfect sense if you are writing it.