I'm trying to write the equation below, but getting the error: Undefined control sequence., which I'm not sure what it means.

 { w }_{ { l }_{ n } }={ w }_{ { l }_{ n } }+{ { \left| { \mu  }_{ 1
 }-{ \mu  }_{ 2 } \right|  } }_{ { l }_{ n } }^{ 2 }\times \eta \times
 { l }_{ n }\times { \E  }_{ l+1 }\times \frac { d }{ dx } \varphi

Any ideas on how I can solve the issue?


  • 2
    Member for 5 years, asked 19 questions, and you don't know how to highlight code. It baffles me. Why don't you post a proper minimal example? After five years. – Johannes_B May 3 '18 at 5:11
  • 3
    Without setting up a document... What is \E supposed to be? – Johannes_B May 3 '18 at 5:12
  • @Johannes_B Thanks for your kind comments. \E is meant to be "epsilon". I might need to use \epsilon instead? – Simplicity May 3 '18 at 5:17
  • 1
    @Simplicity I didn't find any errors in your tag, except \E, that I replaced as \epsilon per you siad... – MadyYuvi May 3 '18 at 5:20
  • 1
    but the error message (which you did not show) would show that it was \E that was not defined, so that should have been clear from the start. Why do you have all the spurious braces? – David Carlisle May 3 '18 at 7:05

In addition to providing a definition for \E, you may also want to make a habit of not overusing curly braces for grouping purposes. To TeX, { w } and w are the same, as are { l } and l, { n } and n, etc etc. The blizzard of curly braces may create the illusion of being careful in one's coding, but it's just that: an illusion, as the \E incident reveals. In fact, I'd argue that the blizzard of curly braces made it difficult for you to spot the error.

Here's how I'd rewrite the equation. Note that in addition to getting rid of the pointless pairs of curly braces, I also replaced all instances of \times with \cdot. Actually, if this were my own document, I wouldn't even provide \cdot.

\usepackage{amsmath}    % for '\lvert' and `\rvert'
\newcommand\E{\epsilon} % per the OP's comment
w_{l_n} = w_{l_n} + \lvert \mu_1 - \mu_2 \rvert_{l_n}^2 
\cdot \eta \cdot l_n \cdot \E_{l+1} \cdot \frac{d}{dx} \varphi

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.