# Command output goes off page

\documentclass{article}

\usepackage{mathtools} % see http://ctan.org/pkg/mathtools
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\DeclareMathOperator{\tr}{tr}

\begin{document}
$$\varphi(x)= \varphi(\beta)+ (x-\beta)\varphi^{'}(\alpha)+\int_{\alpha}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds$$
Let us take the integral $\int_{\alpha}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds$ on the right hand side. \\
\\ Now applying the definition of Green's function, we get
\begin{eqnarray*}
\int_{\alpha}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds =& \int_{\alpha}^{x}G_{2}(x,s)\varphi^{''}(s)ds + \int_{x}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds.\\
=& \int_{\alpha}^{x}(x-\beta)\varphi^{''}(s)ds + \int_{x}^{\beta}(s-\beta)\varphi^{''}(s)ds.\\
=& (x - \beta ) \int_{\alpha}^{x} \varphi^{''}(s)ds + (s - \beta )\int_{x }^{\beta}\varphi^{''}(s) ds - \left[\int_{x}^{\beta}\left(\frac{d}{ds}(s-\beta ) \int \varphi^{''}(s) ds \right) ds\right]  \\
=& (x -\beta ) \varphi^{'}(s) |_{\alpha}^{x} + (s-\beta)\varphi^{'}(s) |_{x}^{\beta} - \int_{x}^{\beta} 1 \cdot \varphi{'}(s)ds. \\
=& (x -\beta ) \varphi^{'}(x) - (x -\beta ) \varphi^{'}(\alpha) + (\beta -\beta ) \varphi^{'}(\beta) - (x -\beta ) \varphi^{'}(x) -  \varphi(s) |_{x}^{\beta}\\
=&\varphi^{'}(x)\left[(x-\beta)-(x-\beta)\right] - (x-\beta)\varphi^{'}(\alpha) - \varphi(\beta)+\varphi(x)\\
&= \varphi(x)-\varphi(\beta)-(x-\beta)\varphi^{'}(\alpha)\\
\Rightarrow \qquad \varphi(x) = \varphi(\beta) +(x- \beta ) \varphi^{'}(\alpha) +  \int_{\alpha }^{\beta} G_{2}(x,s)\varphi^{''}(s)ds.\\
\text{Which is the required proof of Lemma.}
\end{eqnarray*}
\end{document}


• First of, never use eqnarray it is broken env only kept for compatability, change it to align* instead, and here use &= not =&. Secondly you're missing & on the last row, so alignment thinks everything needs to go into the left column of the alignment. Third, never use \\ in the text, if you find your self using \\ in the text, then you're doing something wrong. There should be a new paragraph there, aka a blank line in the code (and yes, new paragraphs should be indented, it does so for a reason). Aug 4 at 7:53
• Here's why eqnarray should never be used: tex.stackexchange.com/a/197/3929 Aug 4 at 7:56

As daleif pointed out in his comment, eqnarray shouldn't really be used nowadays (see eqnarray vs align). I propose a version with align* and a nested aligned. Something with multline would be also possible.

• In my opinion the last equality sign has no reason to be aligned with the other ones, so I type the last line as a separate equation.
• In math mode the ' is an active character which already puts primes as superscripts. Using ^{'} and ^{''} is thus wrong: write simply ' and ''.
• I prefer adding a small space \, in front of the differential, but that's (partly) a matter of taste.
• I see no reason to put a full stop after each line.
• For the vertical bar "evaluated at" I use \bigr: the big part makes it slightly bigger, and the r identifies it as a right delimiter.
• You were using \left/\right twice. The first time (around the integral) gives far too large brackets (IMO). The second occurrence wasn't doing anything.
\documentclass{article}

\usepackage{geometry} % for more generous margins
\usepackage{mathtools}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\DeclareMathOperator{\tr}{tr}

\begin{document}
Now applying the definition of Green's function, we get
\begin{align*}
\int_{\alpha}^{\beta}G_{2}(x,s)\varphi''(s) \, ds
&= \int_{\alpha}^{x}G_{2}(x,s)\varphi''(s) \, ds + \int_{x}^{\beta}G_{2}(x,s)\varphi''(s) \, ds\\
&= \int_{\alpha}^{x}(x-\beta)\varphi''(s) \, ds + \int_{x}^{\beta}(s-\beta)\varphi''(s) \, ds\\
&= (x - \beta ) \int_{\alpha}^{x} \varphi''(s) \, ds
\begin{aligned}[t]
&+ (s - \beta )\int_{x }^{\beta}\varphi''(s) ds \\
&- \biggl[\int_{x}^{\beta}\left(\frac{d}{ds}(s-\beta ) \int \varphi''(s) ds \right) ds\biggr]
\end{aligned}
\\
&= (x -\beta ) \varphi'(s)\bigr|_{\alpha}^{x} + (s-\beta)\varphi'(s)\bigr|_{x}^{\beta} - \int_{x}^{\beta} 1 \cdot \varphi{'}(s) \, ds \\
&= (x -\beta ) \varphi'(x) - (x -\beta ) \varphi'(\alpha) + (\beta -\beta ) \varphi'(\beta) - (x -\beta ) \varphi'(x) -  \varphi(s)\bigr|_{x}^{\beta} \1ex] &=\varphi'(x)\bigl[(x-\beta)-(x-\beta)\bigr] - (x-\beta) \varphi'(\alpha) - \varphi(\beta) + \varphi(x) \\[1ex] &= \varphi(x)-\varphi(\beta)-(x-\beta)\varphi'(\alpha) , \end{align*} from which we find \[ \varphi(x) = \varphi(\beta) +(x- \beta ) \varphi'(\alpha) + \int_{\alpha }^{\beta} G_{2}(x,s)\varphi''(s) \, ds,
which is the required proof of Lemma.

\end{document}


\documentclass{article}
\usepackage{fullpage}
\usepackage{mathtools} % see http://ctan.org/pkg/mathtools
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\DeclareMathOperator{\tr}{tr}

\begin{document}
$$\varphi(x)= \varphi(\beta)+ (x-\beta)\varphi^{'}(\alpha)+\int_{\alpha}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds$$
Let us take the integral $\int_{\alpha}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds$ on the right hand side. \\
\\ Now applying the definition of Green's function, we get
\begin{eqnarray*}
\int_{\alpha}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds &=& \int_{\alpha}^{x}G_{2}(x,s)\varphi^{''}(s)ds + \int_{x}^{\beta}G_{2}(x,s)\varphi^{''}(s)ds.\\
&=& \int_{\alpha}^{x}(x-\beta)\varphi^{''}(s)ds + \int_{x}^{\beta}(s-\beta)\varphi^{''}(s)ds.\\
&=& (x - \beta ) \int_{\alpha}^{x} \varphi^{''}(s)ds + (s - \beta )\int_{x }^{\beta}\varphi^{''}(s) ds - \left[\int_{x}^{\beta}\left(\frac{d}{ds}(s-\beta ) \int \varphi^{''}(s) ds \right) ds\right]  \\
&=& (x -\beta ) \varphi^{'}(s) |_{\alpha}^{x} + (s-\beta)\varphi^{'}(s) |_{x}^{\beta} - \int_{x}^{\beta} 1 \cdot \varphi{'}(s)ds. \\
&=& (x -\beta ) \varphi^{'}(x) - (x -\beta ) \varphi^{'}(\alpha) + (\beta -\beta ) \varphi^{'}(\beta) - (x -\beta ) \varphi^{'}(x) -  \varphi(s) |_{x}^{\beta}\\
&=& \varphi^{'}(x)\left[(x-\beta)-(x-\beta)\right] - (x-\beta)\varphi^{'}(\alpha) - \varphi(\beta)+\varphi(x)\\
&=& \varphi(x)-\varphi(\beta)-(x-\beta)\varphi^{'}(\alpha)\\
\Rightarrow \qquad \varphi(x) &=& \varphi(\beta) +(x- \beta ) \varphi^{'}(\alpha) +  \int_{\alpha }^{\beta} G_{2}(x,s)\varphi^{''}(s)ds,
\end{eqnarray*}
which is the required proof of Lemma.
\end{document}


• What's with all the hard line breaks and eqnarray? Aug 4 at 18:29
• @Werner, I hope it is OK for me to focus only on the issue raised by OP. Thanks for your comments. Aug 5 at 16:58
• It's often the case to just focus on that, since we usually request those who ask questions to only ask a single question. I'd suggest to also prod folks to use common good practices on other things if they arise. In this case, the use of eqnarray. In a similar way, if someone just provides a code snippet, the answerer often wraps the snippet with a \documentclass and some packages... sometimes these packages aren't used by the OP, but it gives them a suggestion as to what a document structure would look like to produce the output; that is, you're doing more than what was asked. Aug 5 at 17:46
• Nice to know that it's merely a suggestion. Your one-line comment gave me the wrong impression that this is a requirement for people posting a potential answer. Aug 5 at 19:20
• ....sure thing! Aug 5 at 22:33