TeX - LaTeX Asked by rmp on May 5, 2021
I am putting my solutions in latex format but I can’t write it properly because I can’t align (see image). Is there any way that I can align the u
and du
to the integrands in the image?
Like this?
documentclass{article}
usepackage{amsmath}
begin{document}
begin{align}
intfrac{cos y}{sin y}, dy & = intfrac{cos x}{sin x}, dx
begin{aligned}
u & = sin y
du & = cos(y), dy
end{aligned} &qquad begin{aligned}
u & = cos x
du & = -sin(x), dx
end{aligned}
end{align}
end{document}
or
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation}
underbrace{intfrac{cos y}{sin y}, dy}_{%
begin{aligned}
u & = sin y
du & = cos(y), dy
end{aligned}} = underbrace{intfrac{cos x}{sin x}, dx}_{%
begin{aligned}
u & = cos x
du & = -sin(x), dx
end{aligned}}
end{equation}
end{document}
Correct answer by Zarko on May 5, 2021
You may want to have the substitutions right aligned with the integral on the left and left aligned with the one on the right.
You can use alignat
in order to make multiple alignment points.
documentclass{article}
usepackage{amsmath}
begin{document}
begin{alignat*}{2}
intfrac{cos(y)}{sin(y)}, dy & ={} &&! intfrac{cos(x)}{sin(x)}, dx
begin{aligned}
u & = sin(y)
du & = cos(y), dy
end{aligned}
&&&
begin{aligned}
u & = cos(x)
du & = -sin(x), dx
end{aligned}
end{alignat*}
end{document}
I won't question the math, which seems just a mockery for a real situation.
Notes.
={}
is needed in order to get correct spacing: no space after the =
sign would be added by TeX, otherwise.!
before int
is needed to avoid incorrect spacing: after an odd-numbered &
, alignat
adds {}
(that is responsible for the correct spacing of the relation symbol that usually starts even-numbered columns); in this case it would add a thin space because int
follows immediately.Answered by egreg on May 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP