2

i am at the moment trying to make this equation more readable by splitting it but can't seem to it using the mentioned packages, i tried using dmath but that messed up other parts of the equations..

\begin{multline}
C\left( t,t_{i-1},t_i,X_{i-1},X_{i},\dot{X}_{i-1},\dot{X}_i \right) = \left[-2\left(P_f - P_s\right) + 
\left(t_f  - t_s \right) \left( V_s  + V_f\right)\right] \left[ \frac{t-t_s}{t_f - t_s}\right]^3 +  
\left[3\left(P_f - P_s\right) - \left(t_f - t_s\right)\left(2V_s + V_f\right)\right]\left[\frac{t-t_s}{t_f  - t_s}\right]^2 + V_s(t-t_s) + P_s
\end{multline}
6
  • multline doesn't break lines all by itself. you need to insert \\ where you want the lines to break. (and welcome to tex.sx.) Commented Jan 6, 2016 at 22:04
  • i tried to at i at the +, which gave me other errors.
    – dfh
    Commented Jan 6, 2016 at 22:11
  • this doesn't work
    – dfh
    Commented Jan 6, 2016 at 22:11
  • \begin{multline} C\left( t,t_{i-1},t_i,X_{i-1},X_{i},\dot{X}_{i-1},\dot{X}_i \right) = \left[-2\left(P_f - P_s\right) + \\ \left(t_f - t_s \right) \left( V_s + V_f\right)\right] \left[ \frac{t-t_s}{t_f - t_s}\right]^3 + \left[3\left(P_f - P_s\right) - \left(t_f - t_s\right)\left(2V_s + V_f\right)\right]\left[\frac{t-t_s}{t_f - t_s}\right]^2 + V_s(t-t_s) + P_s \end{multline}
    – dfh
    Commented Jan 6, 2016 at 22:11
  • 1
    You can't break a \left \right pair with \\ . If you have to break the line inside a pair of large delimiters, you must size them yourself using \big, \Big, etc. Commented Jan 6, 2016 at 22:13

1 Answer 1

1

Three possible versions (note the elimination of most \left and \right):

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{multline}
C(t,t_{i-1},t_i,X_{i-1},X_{i},\dot{X}_{i-1},\dot{X}_i) = 
[-2(P_f - P_s) + (t_f - t_s ) (V_s + V_f)] \left[ \frac{t-t_s}{t_f - t_s}\right]^3 \\
+ [3(P_f - P_s) - (t_f - t_s)(2V_s + V_f)]\left[\frac{t-t_s}{t_f  - t_s}\right]^2 + V_s(t-t_s) + P_s
\end{multline}

\begin{multline}
C(t,t_{i-1},t_i,X_{i-1},X_{i},\dot{X}_{i-1},\dot{X}_i) \\
= [-2(P_f - P_s) + (t_f - t_s ) (V_s + V_f)] \left[ \frac{t-t_s}{t_f - t_s}\right]^3 \\
+ [3(P_f - P_s) - (t_f - t_s)(2V_s + V_f)]\left[\frac{t-t_s}{t_f  - t_s}\right]^2 + V_s(t-t_s) + P_s
\end{multline}

\begin{equation}
\begin{split}
C(t,t_{i-1},t_i&,X_{i-1},X_{i},\dot{X}_{i-1},\dot{X}_i) \\
={}& [-2(P_f - P_s) + (t_f - t_s ) (V_s + V_f)] \left[ \frac{t-t_s}{t_f - t_s}\right]^3 \\
&+ [3(P_f - P_s) - (t_f - t_s)(2V_s + V_f)]\left[\frac{t-t_s}{t_f  - t_s}\right]^2 \\
&+ V_s(t-t_s) + P_s
\end{split}
\end{equation}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .