0

I have been successfully using "split" to split up long equation, but now I get a new error:

 \begin{equation}
   \begin{split}
    \alpha_0=\frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\text{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\text{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\text{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\text{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\text{d}t\\ \alpha_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi}
     \end{split}
\end{equation}

gives a lot of errors

I have tried many version, but can't get that $\alpha_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi}$ to start at the second line, to the left...

Any ideas welcomed!

Thanks

7
  • 2
    I can't find the \begin{split} in your example... (and to split you use \\`, &` is for align)
    – Rmano
    Apr 24, 2023 at 13:28
  • See update.....
    – vqngs
    Apr 24, 2023 at 13:30
  • 1
    You have a runaway argument. Check it (writing the formula on different input lines, with logical spacing and indeneting, will help a lot).
    – Rmano
    Apr 24, 2023 at 13:32
  • 1
    \frac{3(\pi-\frac{\pi}{2}){\pi} is missing a closing brace for the outer fraction's numerator
    – Dai Bowen
    Apr 24, 2023 at 13:33
  • 1
    Unrelated, don't use \text like that. That is not what \text is for and in certain cases it will produce the wrong result. Use \mathrm{d} etc insted.
    – daleif
    Apr 24, 2023 at 13:34

2 Answers 2

4

\frac{3(\pi-\frac{\pi}{2}){\pi} is giving an unmatched brace (this is presumably the first error you are seeing, and once resolved should fix the subsequent errors) and should probably be \frac{3(\pi-\frac{\pi}{2})}{\pi}.

Preferring \mathrm{d} (Is there a preference of when to use \text and \mathrm?), then you simply need to set an alignment point on the first equals sign

\documentclass{article}
\usepackage{amsmath}
\begin{document}
 \begin{equation}
  \begin{split}
   \alpha_0 &= \frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\mathrm{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\mathrm{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\mathrm{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\mathrm{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\mathrm{d}t\\ 
   \alpha_0 &= \frac{5}{2}+\frac{3(\pi-\frac{\pi}{2})}{\pi}
  \end{split}
 \end{equation}
\end{document}

enter image description here

3

Compiling using aligned enviroment you get the same result.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
 \begin{equation}
  \begin{aligned}
   \alpha_0 &= \frac{1}{\pi}\int_{-\pi}^{\pi}F(y)dy=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}dy+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}dy+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}dy+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}dt\\ 
   \alpha_0 &= \frac{5}{2}+\frac{3(\pi-\frac{\pi}{2})}{\pi}
  \end{aligned}
 \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 .