0

I am new here, no idea how latex works, found this format to easily work but I can't use the usual align method with it.

\[f(x)=p_n(x)+R_{n+1}(x) \]
\[p_n(x)=f(x_0)+\frac{(x-x_0)}{1!}f'(x_0)+...+\frac{(x-x_0)^n}{n!}f^(n)(x_0) \]
\[ R_{n+1}(x)=\frac{1}{n!}\int\limits_{x_0}^x (x-t)^n f^{n+1}(t) \ dt \]

These are my formulas

I tried using

\begin(align)
\[f(x)&=p_n(x)+R_{n+1}(x) \]
\[p_n(x)&=f(x_0)+\frac{(x-x_0)}{1!}f'(x_0)+...+\frac{(x-x_0)^n}{n!}f^(n)(x_0) \]
\[ R_{n+1}(x)&=\frac{1}{n!}\int\limits_{x_0}^x (x-t)^n f^{n+1}(t) \ dt \]
\end(align)

But it gave me a bunch of errors. I am using these packages:

\usepackage[parfill]{parskip}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
  • You should use either the align environment OR \[...\] but NOT both. In your align code, eliminates \[ and replace \] by `\\`. – user121799 Mar 19 '17 at 18:04
  • thanks that worked, is there an easy way to change the numbering scheme next to equations rather than have them be 1, 2, 3 etc? for example if I want them to be 1.1 , 1.2, 1.3 – Alex Mar 19 '17 at 18:12
  • yes, either with \begin{subequations} and \end{subequations} or \numberwithin{equation}{section}, depending on what you want. The first option yields (1a), (1b) and so on while the second gives you (1.x) in section 1, (2.y) in 2 etc. – user121799 Mar 19 '17 at 18:23
  • Related (possible duplicate): tex.stackexchange.com/questions/98397/enumerate-formulas/… – Ethan Bolker Mar 19 '17 at 18:23
1

You might wanna use equation environment with the array as well, so you can align them on the same vertical line. Here is an example of what it should look like:

\begin{equation}
\begin{array}{l}
f(x)=p_n(x)+R_{n+1}(x) \\
p_n(x)=f(x_0)+\frac{(x-x_0)}{1!}f'(x_0)+...+\frac{(x-x_0)^n}{n!}f^(n)(x_0) \\
R_{n+1}(x)=\frac{1}{n!}\int\limits_{x_0}^x (x-t)^n f^{n+1}(t) \ dt \\
\end{array}
\end{equation}

The output should be what you're looking for, I hope.

EDIT:

To align them on the equal sign, then you might wanna use align* and then align with the & symbol. Here is an example:

\begin{align*}
f(x) &=p_n(x)+R_{n+1}(x) \\
p_n(x) &=f(x_0)+\frac{(x-x_0)}{1!}f'(x_0)+...+\frac{(x-x_0)^n}{n!}f^(n)(x_0) \\
R_{n+1}(x) &=\frac{1}{n!}\int\limits_{x_0}^x (x-t)^n f^{n+1}(t) \ dt
\end{align*}

Hope that helps.

EDIT:

To change the numbering of the equations to 3.1 instead of 1, you can use the tag element. Here is an example:

\begin{equation}
\begin{align*}
f(x) &=p_n(x)+R_{n+1}(x) \\
p_n(x) &=f(x_0)+\frac{(x-x_0)}{1!}f'(x_0)+...+\frac{(x-x_0)^n}{n!}f^(n)(x_0) \\
R_{n+1}(x) &=\frac{1}{n!}\int\limits_{x_0}^x (x-t)^n f^{n+1}(t) \ dt\tag{3.1}\label{eq:3.1}
\end{align*}
\end{equation}

Hope that helps.

  • Thanks that kind of works but I prefer them aligned at the equal sign. – Alex Mar 19 '17 at 18:12
  • What is the best practice? to use amsmath or the equation thing you're using? – Alex Mar 19 '17 at 18:13
  • I have edited my answer, to suit your needs. – halsten Mar 19 '17 at 18:17
  • I have edited my answer again to answer your question in the other comments section. – halsten Mar 19 '17 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.