4

I want something like this :

enter image description here

My code

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent Et pour tout $x$ de $\left [ \alpha, 1 \right ]$ on a : 
        \begin{align*}
            \left ( 2x-x\ln x \right )'&=2-\left ( 1 \times \ln x +x \times \ln x \right )\\
            &=2-\ln x -1\\
            &=1-\ln x
        \end{align*}
D'où $x \mapsto 2x-x\ln x$ est une primitive de la fonction $x \mapsto 1-\ln x$ sur $\left [ \alpha, 1 \right ]$.
\end{document}

give me something like this

enter image description here

I want my equations to start from the text line not after.

And I think the verical spacing at the end of "align" is too much

2
  • It should be noted that all current answers don't work nice when the line before the multi-line math block is longer. The math block will protrude into the margin. Jun 9 at 0:59
  • So you want to remove the hard return between the lines?
    – Indigo Cat
    Jun 9 at 16:34

3 Answers 3

5

You can use a [t]op-aligned array or aligned environment:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\noindent
Et pour tout $x$ de $[ \alpha, 1]$ on a: 
$\begin{array}[t]{ @{} r @{} l @{} }
  ( 2 x - x \ln x )' & {} = 2 - ( 1 \times \ln x + x \times \ln x ) \\[\jot]
                     & {} = 2 - \ln x - 1                           \\[\jot]
                     & {} = 1 - \ln x
\end{array}$

D'où $x \mapsto 2 x - x \ln x$ est une primitive de la fonction $x \mapsto 1 - \ln x$ sur $[ \alpha, 1 ]$.

\noindent
Et pour tout $x$ de $[ \alpha, 1]$ on a: 
$\begin{aligned}[t]
  ( 2 x - x \ln x )' &= 2 - ( 1 \times \ln x + x \times \ln x ) \\
                     &= 2 - \ln x - 1                           \\
                     &= 1 - \ln x
\end{aligned}$

D'où $x \mapsto 2 x - x \ln x$ est une primitive de la fonction $x \mapsto 1 - \ln x$ sur $[ \alpha, 1 ]$.

\end{document}
3

You could use a TABstack, in particular, an \alignLongunderstack:

\documentclass{article}
\usepackage{amsmath,tabstackengine}
\strutlongstacks{T}
\TABstackMath
\begin{document}
\noindent Et pour tout $x$ de $\left [ \alpha, 1 \right ]$ on a : 
        \alignLongunderstack{
            \left ( 2x-x\ln x \right )'&=2-\left ( 1 \times \ln x +x \times \ln x \right )\\
            &=2-\ln x -1\\
            &=1-\ln x
        }\\
D'où $x \mapsto 2x-x\ln x$ est une primitive de la fonction $x \mapsto 1-\ln x$ sur $\left [ \alpha, 1 \right ]$.
\end{document}

enter image description here

2

You could use the aligned environment:

\documentclass{article}
\usepackage{amsmath}

\setlength{\parindent}{0cm}

\begin{document}
    Et pour tout $x$ de $\left[ \alpha, 1 \right]$ on a: $\begin{aligned}[t]
    \left( 2x-x\ln x \right)'&=2-\left( 1 \times \ln x +x \times \ln x \right)\\
    &=2-\ln x -1\\
    &=1-\ln x
    \end{aligned}$

    D'où $x \mapsto 2x-x\ln x$ est une primitive de la fonction $x \mapsto 1-\ln x$ sur $\left[\alpha, 1 \right]$.
\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 .