TransWikia.com

This equation keep giving me error messages

TeX - LaTeX Asked on November 16, 2021

I am trying to post a explanation on aops and it keeps saying

Error compiling LaTeX. ! File ended while scanning use of align*.

Please get back ASAP, it’s homework thanks in advance.

begin{align*}
frac{6sqrt{{(x+1)(x+3)+1}-12}{2x}\
&=frac{6sqrt{x^2+4x+3+1}-12}{2x}\
&=frac{6sqrt{x^2+4x+4}-12}{2x}\
&=frac{6(x+2)-12}{2x}\
&=frac{6x+12-12}{2x}\
&=frac{6x}{2x}=3
end{align*}

3 Answers

Your problems is already solved in other answers, but you may liked the following solution which employ the instruction MoveEqLeft defined in the mathtools package:

documentclass{article}
usepackage{mathtools}

begin{document}
begin{align*}
    MoveEqLeft[3]
frac{6sqrt{{(x+1)(x+3)+1}-12}}{2x}        \
     & =frac{6sqrt{x^2+4x+3+1}-12}{2x}     
       =frac{6sqrt{x^2+4x+4}-12}{2x}      \ & =frac{6(x+2)-12}{2x}                 
       =frac{6x+12-12}{2x}                 \
     & =frac{6x}{2x}=3
end{align*}
end{document}

enter image description here

(red lines indicate text area borders)

Answered by Zarko on November 16, 2021

Errors in the first line are the cause, ie mismatched { }. A fix is:

begin{align*}
frac{6sqrt{(x+1)(x+3)+1}-12}{2x}
&=frac{6sqrt{x^2+4x+3+1}-12}{2x} \
&=frac{6sqrt{x^2+4x+4}-12}{2x} \
&=frac{6(x+2)-12}{2x} \
&=frac{6x+12-12}{2x} \
&=frac{6x}{2x} = 3
end{align*}

which produces:

enter image description here

Answered by Leucippus on November 16, 2021

Note

  • align* environment enters math mode for you, so there is node need to wrap it in between $$ ... $$.
  • The left brace of numerator of first frac is never closed by a pairing right brace.
  • You might need & mathrel{phantom{=}} prepended to first line of align*.
documentclass{article}
usepackage{amsmath}

begin{document}
begin{align*}
     & mathrel{phantom{=}}frac{6sqrt{{(x+1)(x+3)+1}-12}}{2x} \
     & =frac{6sqrt{x^2+4x+3+1}-12}{2x}                         \
     & =frac{6sqrt{x^2+4x+4}-12}{2x}                           \
     & =frac{6(x+2)-12}{2x}                                     \
     & =frac{6x+12-12}{2x}                                      \
     & =frac{6x}{2x}=3
end{align*}
end{document}

enter image description here

Answered by muzimuzhi Z on November 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP