3
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{vietnam}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts} 
\begin{document}
\begin{align*}
     $||x + y||^{2} &=\displaystyle\sum_{j=1}^{n}|x_{j}+y_{j}|^{2} \\
     &\leq\displaystyle\sum_{j=1}^{n}|x_{j}|^{2}+2 \displaystyle\sum_{j=1}^{n}|x_{j}||y_{j}| +\displaystyle\sum_{j=1}^{n} |y_{j}|^{2} \\
     &\leq \displaystyle\sum_{j=1}^{n}|x_{j}|^{2} + 2 \bigg(\displaystyle\sum_{j=1}^{n}|x_{j}|^{2}\bigg) ^{\dfrac{1}{2}}\bigg(\displaystyle\sum_{j=1}^{n}|y_{j} |^{2}\bigg)^{\dfrac{1}{2}}+\displaystyle \sum_{j=1}^{n}|y_{j} |^{2}\\
    &= \bigg[\bigg(\displaystyle\sum_{j=1}^{n} |x_{j}|^{2}\bigg)^{\dfrac{1}{2}}+\bigg(\displaystyle \sum_{j=1}^{n} |y_{j}|^{2}\bigg)^{\dfrac{1}{2}}\bigg]^{2}. \\$
\end{align*}
\end{document}
4
  • 4
    Welcome to TeX.SX! This site is in English, so please consider translating your question into English. Also, you might want to add some more information, as currently you mainly just post some code. Use the "Edit" link below your question to this end. Dec 6, 2023 at 9:24
  • Off-topic: There's no need to load the amsfonts package manually, as it's loaded automatically by the amssymb package.
    – Mico
    Dec 6, 2023 at 9:31
  • 2
    To compile your code successfully, you must remove the $ symbols after \begin{align*} and before \end{align*}. Separately, the \displaystyle directives are redundant; and, do replace \dfrac with \frac.
    – Mico
    Dec 6, 2023 at 9:32
  • don't do \displaystyle\sum the display style affects the rest of the expression not just the \sum (although here it does nothing as you are already in display style) Dec 6, 2023 at 11:44

2 Answers 2

3

In addition to getting rid of the $ symbols at the start and end of the align* environment and dropping the redundant \displaystyle directives, you should also replace all instances of ^{\dfrac{1}{2}} with ^{1/2}, saving a lot of vertical whitespace. I think it would also be a good idea to add an additional line, as is shown below. Separately, do consider loading the mathtools package (a superset of the amsmath package) and using its \DeclarePairedDelimiter macro to define \abs and \norm, to make the code much more readable and easier to debug. Finally, don't just write \bigg( and \bigg) but, rather \biggl( and \biggr), for improved spacing around the tall delimiter.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[T5]{fontenc}
\usepackage[vietnamese]{babel}
\usepackage{amssymb} % amssymb loads amsfonts automatically
\usepackage{mathtools} % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter\abs\lvert\rvert
\DeclarePairedDelimiter\norm\lVert\rVert
\newcommand\sumj{\sum_{j=1}^n} % handy shortcut macro
 
\begin{document}

\begin{align*}
\norm{x + y}^2 
&=        \sumj\abs{x_j + y_j}^2 \\
&\le      \sumj\abs{x_j}^2
        +2\sumj\abs{x_j}\abs{y_j} 
         +\sumj\abs{y_j}^2 \\
&\le      \sumj\abs{x_j}^2 + 
  2\biggl(\sumj\abs{x_j}^2\!\biggr)^{\!\!1/2}
   \biggl(\sumj\abs{y_j}^2\!\biggr)^{\!\!1/2}
         +\sumj\abs{y_j}^2 \\
&= \biggl[
   \biggl(\sumj\abs{x_j}^2\!\biggr)^{\!\!1/2}
  +\biggl(\sumj\abs{y_j}^2\!\biggr)^{\!\!1/2}
 \,\biggr]^2 \\
&=  \bigl( \norm{x} + \norm{y} \bigr)^{\!2}.
\end{align*}

\end{document}
1

It's rather unclear to understand what is going on here. Please consider using syntax highlighting and properly input the code.

Anyways, hoping I understood you, there are a few mistakes.

  • why did you use $ within the align environment?
  • Why are you using double vertical bars for norms instead of \lVert and \rVert?
  • No reason to use \displaystyle

A fixed code would be something like

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{vietnam}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts} 

\begin{document}
\begin{align*}
    \lVert x + y \rVert^2 &= \sum_{j=1}^{n} \lvert x_{j} + y_{j} \rvert^2 \\
    &\leq \sum_{j=1}^{n} \lvert x_{j} \rvert^2 + 2 \sum_{j=1}^{n} \lvert x_{j} \rvert \lvert y_{j} \rvert + \sum_{j=1}^{n} \lvert y_{j} \rvert^2 \\
    &\leq \sum_{j=1}^{n} \lvert x_{j} \rvert^2 + 2 \left( \sum_{j=1}^{n} \lvert x_{j} \rvert^2 \right)^{\frac{1}{2}} \left( \sum_{j=1}^{n} \lvert y_{j} \rvert^2 \right)^{\frac{1}{2}} + \sum_{j=1}^{n} \lvert y_{j} \rvert^2 \\
    &= \left[ \left( \sum_{j=1}^{n} \lvert x_{j} \rvert^2 \right)^{\frac{1}{2}} + \left( \sum_{j=1}^{n} \lvert y_{j} \rvert^2 \right)^{\frac{1}{2}} \right]^2.
\end{align*}
\end{document}

Here is the result, compiled on OverLeaf enter image description here

1
  • 2
    I think the one thing the OP did (almost) right, and which you appear to have clobbered, is the use of 4 pairs of \biggl( and \biggr) in lines 3 and 4. Replacing \biggl( and \biggr) with \left( and \right) makes the parentheses unnecessarily tall.
    – Mico
    Dec 6, 2023 at 9:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .