I have the following set of equations:

y_1' &= y_2\\
y_2' &=\dfrac{1}{m}\left(0.05 \,k_f\, sin\left(\dfrac{2 \pi v}{10} t \right) + 0.05 \,k_r\, sin\left(\dfrac{2 \pi v}{10} t - \dfrac{2 \pi (l_1+l_2)}{d}\right) - (k_f+k_r)y_1 - (k_r l_2-k_f l_1)y_3\right)\\
y_3' &= y_4\\
y_4' &= \dfrac{1}{J_0} \left(0.05\,k_r l_2\, sin\left(\dfrac{2 \pi v}{10} t  - \dfrac{2 \pi (l_1+l_2)}{d}\right) - 0.05\,k_f l_1\, sin\left(\dfrac{2 \pi v}{10} t \right) - (k_r l_2 - k_f l_1) y_1 - (k_r l_2^2 + k_f l_1^2) y_3 \right)

enter image description here

The second and fourth equations are too long, so I'd like to break them across multiple lines. I'm trying to use the split environment, but I'm having trouble getting it to work right. My current best attempt for just the first two equations is:

y_1' &= y_2\\
y_2' &=\dfrac{1}{m}\left(0.05 \,k_f\, sin\left(\dfrac{2 \pi v}{10} t \right) + 0.05 \,k_r\, sin\left(\dfrac{2 \pi v}{10} t - \dfrac{2 \pi (l_1+l_2)}{d}\right) -  \right.\\
&\left.  (k_f+k_r)y_1 - (k_r l_2-k_f l_1)y_3 \right)\\

The result looks like this: enter image description here Somehow the last \right) doesn't know to measure up to the first one, and the equals signs are not actually aligning despite the presence of the ampersands. Also, I would like to make the second line of the second equation move further to the right, but adding an extra & to both lines in appropriate places causes another Extra }, or missing \right error. How would I go about fixing this?


Some suggestions

  • Don't auto-size the outermost parentheses in equations (2) and (4) -- use \biggl[ and \biggr] instead.

    Avoiding the autosizing of the outermost parentheses spares you having to type \right. at the end of the first line and \left. at the start of the second, and having to insert something like \vphantom{\left(\frac{2\pi}{10}\right)} somewhere on the second line in each of the two-line equations just in order to inform LaTeX what the size of the closing \right) parenthesis should be based on.

  • Use \sin instead of sin, and get rid of the \, directives ahead of the \sin terms.

  • Consider loading the mleftright package to get better spacing of the remaining \left( ... \right) pairs.

  • Material in an align environment is in displaymath style by default; no need to write \dfrac instead of just \frac.

enter image description here

\mleftright % for better spacing between "\sin" and "\left("
y_1' &= y_2\\
y_2' &=\frac{1}{m}\biggl[0.05 \,k_f\sin\left(\frac{2 \pi v}{10} t \right) 
       + 0.05 \,k_r\sin\left(\frac{2 \pi v}{10} t - \frac{2 \pi (l_1+l_2)}{d}\right) \notag\\
     &\qquad - (k_f+k_r)y_1 - (k_r l_2-k_f l_1)y_3\biggr]\\
y_3' &= y_4\\
y_4' &= \frac{1}{J_0} \biggl[0.05\,k_r l_2\sin\left(\frac{2 \pi v}{10} t  - \frac{2 \pi (l_1+l_2)}{d}\right) 
      - 0.05\,k_f l_1\sin\left(\frac{2 \pi v}{10} t \right) \notag\\
     &\qquad- (k_r l_2 - k_f l_1) y_1 - (k_r l_2^2 + k_f l_1^2) y_3 \biggr]
  • Regarding your second bullet point: is the reason that Latex isn't sizing the closing parenthesis the way I want because after the line break it doesn't know what it's matching to anymore? And that's what the vphantom stuff would do? Also, why include the notag instead of just doing an align*? – Vyas Nov 16 '15 at 1:05
  • 1
    Ah I see, the notag removes numbering on the extra lines used for spacing – Vyas Nov 16 '15 at 1:06
  • @Vyas - Each and every matched \left...\right pair is independent: What goes on in the \left( \right. pair on one line is entirely separate from what's happening in the \left. \right) pair on the following line. TeX does not have a "super-group" of matched pairs concept. – Mico Nov 16 '15 at 3:04

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.