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}
Alex
  • 1
  • You should use either the align environment OR \[...\] but NOT both. In your align code, eliminates \[ and replace \] by \\\. –  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. –  Mar 19 '17 at 18:23
  • Related (possible duplicate): http://tex.stackexchange.com/questions/98397/enumerate-formulas/98401#98401 – Ethan Bolker Mar 19 '17 at 18:23

1 Answers1

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.

halsten
  • 23