# General Engineering Introduction/Error Analysis/Calculus of Error

Error accumulates through calculations like toxins in the food chain. For example suppose one was to measure the width of a room with a ruler. Suppose each ruler measurement is 1 foot ± .1 foot. Suppose the room is about 10 feet wide. This would require 10 measurements. Each measurement would have an error of .1 foot. The accumulated error that occurred while measuring 10 times would be 10*.1 = 1 foot or 10 feet ± 1 foot. It could be anywhere between 9 and 11 feet wide. A tape measure could measure the width of the same room more accurately.
The goal of this section is to show how to compute error accumulation for all equations. This is most easily done with calculus, but some parts of this can be done with algebra and even intuition.
This is a starting point. The techniques should generate questions such as how do I deal with non-symmetric error? What if the error is negative? This will lead to future classes. The techniques below predict maximum, symmetrical error. That is it. Future analysis classes can reduce the error based upon more detailed knowledge of the experiment or project.
Symbols used:
* independent variables: x, t and z
* dependent variable: y
* error: $\sigma$
* constant: C

## +-*/^ trig functions

Associated with each error analysis below is a proof.

### Multiplying by a Constant

    if $y=C*x$ then ${\delta _{y}}=C*{\delta _{x}}$ proof

### Adding & Subtracting

    if $y=x+z$ or $y=x-z$ then $\delta _{y}={\sqrt {\delta _{x}^{2}+\delta _{z}^{2}}}$ proof

### Multiplying & Dividing

    if $y=x*z$ then $\delta _{y}={\sqrt {(z\delta _{x})^{2}+(x\delta _{z})^{2}}}$
    if $y=x/z$ then $\delta _{y}={\sqrt {\left({\frac {\delta _{x}}{z}}\right)^{2}+\left({\frac {x\delta _{z}}{z^{2}}}\right)^{2}}}$ proof

### Raising to a power

    if $y=x^{C}$ then $\delta _{y}=C\delta _{x}x^{C-1}$ proof

### Trig

    if $y=cos(x)$ then $\delta _{y}=\delta _{x}*sin(x)$
    if $y=sin(x)$ then $\delta _{y}=\delta _{x}*cos(x)$
    if $y=tan(x)$ then $\delta _{y}={\frac {\delta _{x}}{(1+x^{2})}}$ x in radians

## In General

In general partial differentials ($\partial$) have to be used which involves squaring every term and then taking the square root (see propagation of uncertainty):
       if $y=f(x,t,z)$ then $\delta _{y}={\sqrt {\left(\delta _{x}{\frac {\partial f(x,t,z)}{\partial x}}\right)^{2}+\left(\delta _{t}{\frac {\partial f(x,t,z)}{\partial t}}\right)^{2}+\left(\delta _{z}{\frac {\partial f(x,t,z)}{\partial z}}\right)^{2}}}$
For example suppose $x={\frac {1}{2\pi fc}}$ then $\delta _{x}={\sqrt {\left(\delta _{f}{\frac {\partial {\frac {1}{2\pi fc}}}{\partial f}}\right)^{2}+\left(\delta _{c}{\frac {\partial {\frac {1}{2\pi fc}}}{\partial c}}\right)^{2}}}$
Evaluating the differentials:
       $\delta _{x}={\sqrt {\left(\delta _{f}{\frac {1}{2\pi f^{2}c}}\right)^{2}+\left(\delta _{c}{\frac {1}{2\pi fc^{2}}}\right)^{2}}}$
Can substitute $x={\frac {1}{2\pi fc}}$:
       $\delta _{x}={\sqrt {\left(\delta _{f}{\frac {x}{f}}\right)^{2}+\left(\delta _{c}{\frac {x}{c}}\right)^{2}}}$
Dividing through by $x$ puts the entire equation into a final form of percentages:
       ${\frac {\delta _{x}}{x}}={\sqrt {\left({\frac {\delta _{f}}{f}}\right)^{2}+\left({\frac {\delta _{c}}{c}}\right)^{2}}}$
.. which is not exactly the multiplication error performed twice

## Error Analysis Rounding

Typically your instructor will choose which rounding rules to follow. None of these rules tells you which digit or decimal place to round to. Error analysis tells you which digit to round to.
Suppose your answer is 3.263 ± .2244. The extra digits make you feel like you are doing extra work. In reality they will upset any engineer or scientist reading your work. The extra decimal places are meaningless. Do not leave your answer in this form. There is no way to develop intuition about the results.
The error determines the decimal place that is important. First round the error to one digit.
.2244 → .2
This sets the digit that the answer needs to be rounded to. In this case:
3.263 → 3.3
So the answer would be 3.3 ± .2