If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Linearity

When you double the voltage on a resistor, the current doubles. We say a resistor is a linear device. Capacitors and inductors are linear, too. Written by Willy McAllister.

## Introduction

Linearity is a mathematical concept that has a profound impact on electronic design. The idea itself is quite simple, but the implications have great meaning for our field. First we will talk about the mathematical meaning of linear. Then we will apply the idea to electronic circuits.

### What we're building to

A function is linear in the mathematical sense if it has these properties:
Homogeneity (scaling): f, left parenthesis, a, x, right parenthesis, equals, a, f, left parenthesis, x, right parenthesis
Additivity: f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis
When the inputs and outputs are single numbers, a function that has the scaling property automatically has additivity as well. Resistors, capacitors, and inductors are linear because they have the scaling property.

## Linear

The term linearity refers to the property of scaling. Suppose you have two related physical properties, for example the speed you can run and the distance you can run. If you double your speed, you double the distance. If you triple your speed, you triple your distance. This is called a linear relationship. Usually the cost of something is linear. If a notebook costs $1, then ten notebooks will cost$10.
In electronics, an ideal resistor creates a linear relationship between voltage and current. If you double voltage, the current doubles, and vice versa. So we say an ideal resistor is a linear element.

## Scaling (homogeneity)

We want to write this scaling property in mathematical terms. This doubling-begets-doubling can be written as f, left parenthesis, 2, x, right parenthesis, equals, 2, f, left parenthesis, x, right parenthesis. Similarly, tripling-begets-tripling can be written as f, left parenthesis, 3, x, right parenthesis, equals, 3, f, left parenthesis, x, right parenthesis. And in general, the scaling property is
f, left parenthesis, a, x, right parenthesis, equals, a, f, left parenthesis, x, right parenthesis
The fancy mathematical word for this property is homogeneity.
A function that looks like a line through the origin has the scaling property. Let y, equals, f, left parenthesis, x, right parenthesis, equals, 2, x.
If x, equals, 2, then y, equals, 2, dot, 2, equals, 4.
If we double x from 2 to 4, then y, equals, 2, dot, 4, equals, 8.
So doubling x exactly doubles y.
Importantly, because f, left parenthesis, x, right parenthesis is a straight line, the scale factor a does not depend on the value of x.
If the function is any other shape, like y, equals, x, squared or y, equals, 1, slash, x or y, equals, e, start superscript, x, end superscript, the scale factor isn't the same for every x, it depends on x's value.
For example, if y, equals, x, squared, slash, 16,
At x, equals, 4, y, equals, 4, squared, slash, 16, equals, 1, so the scale factor going from x to y is 1, slash, 4.
At x, equals, 8, y, equals, 8, squared, slash, 16, equals, 4, so the scale factor is 1, slash, 2.
For any function that is not a straight line, scaling (amplification) is not constant, but rather depends on the input value, x.
This is the main reason we like to build and use linear amplifiers to make small signals bigger. Every signal is uniformly scaled up by the same amount, so the output looks like a scaled up replica of the input.

When a relationship is linear (has the scaling property), we can derive an adding property. All linear functions have the form of a line with scale factor (slope) a:
f, left parenthesis, x, right parenthesis, equals, a, x
If we make the input the sum of two distinct inputs left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis. Then,
f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, a, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, comma
and using the distributive property,
f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, a, x, start subscript, 1, end subscript, plus, a, x, start subscript, 2, end subscript, point
The terms on the right side are equivalent to:
a, x, start subscript, 1, end subscript, equals, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, a, x, start subscript, 2, end subscript, equals, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis
And now we have an adding property (called additivity in math talk):
f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis
We can use this additivity property in a clever way.
Suppose we have two inputs, x, start subscript, 1, end subscript and x, start subscript, 2, end subscript, and we make each of them an input to a linear function, f, left parenthesis, x, right parenthesis. The outputs are, of course, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis and f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis.
If we add the inputs together, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, and put the sum into f, left parenthesis, x, right parenthesis, by definition the output will be f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis.
Here's the clever part: If f, left parenthesis, x, right parenthesis happens to be a linear function, there is another way to derive the output when x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript is the input. The output can also be computed from the sum of the two individual outputs, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis.
The additivity property of linear functions is called superposition. It is the basis of a circuit analysis technique that goes by the same name. Superposition is put to brilliant use in the Mesh Current Method and in many other engineering areas (especially signal processing).

## Linearity of electronic components

Let's start by looking at a resistor. Mathematically, you might take the point of view that a resistor is a function that takes voltage as an input, and creates a current as an output.
We can tell if an ideal resistor is linear by testing to see if it meets the rule for scaling. We can write Ohm's Law as a function:
i, equals, f, left parenthesis, v, right parenthesis, equals, start fraction, 1, divided by, start text, R, end text, end fraction, v

### Resistor scaling

If we double the voltage across the resistor, the current doubles.
If we push 4 times as much current through the resistor, the voltage goes up by 4 times.

If we apply 1, start text, V, end text, plus, 3, start text, V, end text to the resistor, the resulting current is either
start fraction, 1, start text, V, end text, plus, 3, start text, V, end text, divided by, start text, R, end text, end fraction, equals, start fraction, 4, start text, V, end text, divided by, start text, R, end text, end fraction
or
start fraction, 1, start text, V, end text, divided by, start text, R, end text, end fraction, plus, start fraction, 3, start text, V, end text, divided by, start text, R, end text, end fraction, equals, start fraction, 4, start text, V, end text, divided by, start text, R, end text, end fraction
A resistor has scaling (and therefore automatically has additivity).
A resistor is a linear element.
For a real-world resistor there is of course a limit to the voltage and current. If the power left parenthesis, i, dot, v, right parenthesis is more than the resistor can handle, it may change resistance value as it overheats, or even burn up. So a real resistor is linear only over some range of voltage and current. But an ideal resistor works for any i or v, so an ideal resistor is linear, period.

### Are capacitors and inductors linear?

The capacitor and inductor element laws are
i, equals, start text, C, end text, start fraction, d, v, divided by, d, t, end fraction
and
v, equals, start text, L, end text, start fraction, d, i, divided by, d, t, end fraction
At first glance it might look like these are not equations of lines. But they are. They are lines if we think of the independent variable being d, v, slash, d, t and d, i, slash, d, t instead of just v or i.
i, equals, f, left parenthesis, start fraction, d, v, divided by, d, t, end fraction, right parenthesis, equals, start text, C, end text, start fraction, d, v, divided by, d, t, end fraction
and
v, equals, f, left parenthesis, start fraction, d, i, divided by, d, t, end fraction, right parenthesis, equals, start text, L, end text, start fraction, d, i, divided by, d, t, end fraction
The capacitor law can be graphed as a straight line with d, v, slash, d, t as the horizontal axis and i as the vertical axis. The slope of the capacitor line is start text, C, end text.
Likewise, the inductor law can be graphed as a straight line with d, i, slash, d, t as the horizontal axis and v as the vertical axis. The slope of the inductor line is start text, L, end text.
Ideal capacitors and inductors are linear elements.
Now we have three: start text, R, space, L, space, C, end text.
With just these linear components we can create many interesting electronic functions.

### A diode is a non-linear device

It might help to take a second and talk something that is not a linear device, just for contrast. A diode is a non-linear semiconductor device.
We will learn a lot more about diodes later on. For now, I just want to take a look at its i-v curve as an example of what a non-linear device looks like:
Diode i-v curve of a silicon diode.
This i-v curve is the element law for a diode. It clearly does not look like a straight line, so this is definitely not a linear device. The non-linear behavior of a diode is typical of other semiconductor devices like transistors.

## Why do we make such a big deal about linearity?

Circuit made from linear elements can be solved exactly. In fact, there is a whole branch of mathematics devoted to solving linear functions, called Linear Algebra.
Some examples of greatness: Kirchhoff's Laws work because of linearity, as do the Node Voltage Method and the Loop Current Method.

### Non-linear functions and elements

In general, functions with non-linear behavior don't have these properties. We humans have not come up with a general-purpose method to exactly solve non-linear equations/circuits.
Each new type of circuit requires mathematical techniques specific to the new circuit. The usual approach to non-linear circuits is to bend over backwards to make it seem linear over at least some small range of operation. That's what is happening when you see terms like "piecewise-linear approximation" or "small-signal model."

## Summary

A function is linear if it has these properties:
Homogeneity (scaling): f, left parenthesis, a, x, right parenthesis, equals, a, f, left parenthesis, x, right parenthesis
Additivity: f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis
If x and a are real numbers (as opposed to vectors or arrays), these properties mean the same thing, and you can test for just one of them.
Resistors, capacitors, and inductors are linear elements because they have the scaling property.

### Linearity in words

1. Scaling the input by a scales the output by a.
2. Adding two inputs produces the same output as applying each input individually and adding the two separate outputs.

## Want to join the conversation?

• Let's analyse the equation of a line, for example y=2x+3. A line should be linear by definition. But, if I were to test it by the numbers, I would get strange results. For example, let's plug x=3 and its double, x=6 into the function. The linearity principle states that f(2x) = 2f(x). So, let's try with our linear function y=2x+3.
(1) For x=3, f(3)=2*3+3=9
(2) For x=6, f(6)=2*6+3=15
15 is not the double of 9. What am I getting wrong?
• The term 'linear' has an everyday meaning and a different meaning in mathematics. In everyday language it means "Hey, that looks like a line." In math, it means those two properties in the article (scaling and additivity). Many, but not all, lines have the mathematical property of linearity. Only those lines that pass through the origin (lines whose y-intercept is zero) are linear in the mathematical sense. This particular restriction is what gives rise to all sorts of really good properties of linear circuits.

All linear functions have the form of a line with scale factor (slope) a_:

_f(x) = ax

Could you give us a rigorous proof of this claim? By definition, a linear function has the following property:

f(ax) = af(x)

Could you show us how the statement f(ax) = af(x) implies the statement f(x) = ax ?
• I will use different variables for the given function and the linearity test.

Is f(x) = ax a linear function?

Linearity test:
f(x) is linear if f(bx) = bf(x)

Evaluate both sides of the linearity test and check to see if they are the same.

Left side: f(bx) = a (bx)
Right side: b f(x) = b (ax)

abx = bax

The linearity test passes, so f(x) = ax is a linear function.