# Functions

A function from a set X to a set Y assigns to each element of X exactly one element of Y. The set X is called the domain of the function and the set Y is called the codomain of the function.

## Conic sections

If we cut a two-halved cone with a plane, we get one out of three things:

1. an ellipse

2. a parabola

3. a hyperbola

They look quite different, but that they can all be created through the cone cutting trick shows that they have something in common. Their common name is conics, and they can all be written as second order polynomials in and .

Curiously, the motions of planets, stars and comets are all conics.

### Ellipses and circles

By cutting only the top part or bottom part of the cone, we get an ellipse. The equation of the ellipse looks like this:

If we let , we get a circle, which is a special case of an ellipse.

The constants determine the ratio between the axes. If we draw the ellipse in the -plane and , the ellipse will be more stretched out along the -axis that the -axis, and vice versa.

Planet orbits are elliptical.

### Parabolas

A parabola is what you get if you increase the angle between the plane and the horizontal plane so much that the ellipse slips out of the cone. The parabola is unbounded.

Parabolas can be written as

or interchanging the with the , depending on the orientation of the axes.

### Hyperbolas

Increasing the angle between the horizontal plane and the cone even more, we get to a point where the plane cuts the bottom part of the cone as well as the top part. This gives birth to the hyperbola.

The hyperbola equation looks like this:

Like the parabola, the hyperbola is unbounded, but it's made up of two parts mirroring one another.

If a comet flies towards the earth's vicinity, its velocity will determine whether it will get caught up by the gravity and go into an elliptic orbit, or fly past following a hyperbolic curve.

## Straight lines

### Definition

The equation of a straight line is:

The value is where the line intercepts the -axis and tells us about the slope of the line.

If , the line is sloping up.

If , the line is sloping down.

To calculate , take two points and lying on the line. Then, is defined as

### Example

To find the equation of the line passing through the points and , we want to determine the constants and in the equation:

We start by determining :

Next, determine by writing the equation for the line:

Now, pick one of the two points and plug in its and value into the above equation and solve for . Lets use the point .

Thus, the equation for the line is

The general form of a quadratic function is:

where , , and are constants.

Such a function forms a quadratic curve, also known as a parabola, where defines its width and direction (up or down).

Further, shifts the parabola sideways, as can be seen in the examples below, and determines where the curve cross the -axis.

### Finding roots

We are often interested in finding the points where a function is zero, known as its roots.

Look at the following:

Writing it as is called factorizing, and it allows us to quickly read that its only root is .

When trying to solve it, we get:

Hence, even in cases where we have no real roots, we can still find imaginary or complex ones.

### Complete the square

When we cannot completely factorize a quadratic equation, a trick called completing the square can be of help, which looks as follows:

Then

and we have , making and the two roots.

If none of the methods above are easy to use, we can always turn to the quadratic formula for finding the roots. The formula states that:

for , the general form of a quadratic equation.

## Domain and codomain

Have a look at the function . What happens if we set to ? Division with is strictly forbidden in math land! Not only will it give me bad karma, but it'll also mess up my calculations. If I intended to use for subsequent calculations, maybe using as an input to another function, I'll be in trouble. If , will refuse to return any value.

So mathematicians say falls outside the domain of , because won't return any value there. In calculus, you must be kind to the functions you encounter, ensuring that you only feed them values from their domain.

Also, notice that can return all numbers from to . Therefore, mathematicians say that 's range is the entire real number line. In contrast, can only return positive values, so its range is all positive numbers and .

In the pic below, the blob is the domain and the inner circle of the blob represents the range. But the entire blob is called the codomain.

## Even and odd functions

### Definition of even functions

An even function is a function that is symmetrical about the axis, in mathematical terms this is expressed as

an example of an even function is

In fact all even powers of such as are even functions.

### Definition of odd functions

An odd function is a function that is symmetrical if we flip the part of the graph on the left of the -axis upside down. In mathematical terms this is expressed as

an example of an odd function is

In fact all odd powers of such as are odd functions.

## Composite functions

### Function of functions

A composite function is whenever we put one function as input to another function . This results in a new function, which we will call

There exists a few different notations for . They are:

Generally, will not have the same domain as or .

### Examples

Let with domain and let with all real numbers as domain and let be a composition, then, a few examples are:

## Piece-wise defined functions

A function is like a meat grinder. Feed it an input, and it'll produce something else. If you feed it one lump of meat, there's no way you can get two different kinds of outputs. Our lump of meat can only be squished in one way. You get what you get, kind of.

Ok, it can be quite satisfying watching a meat grinder in action. Just search for 'satisfying video' on YouTube, and you'll likely see a meat grinder. But it does get quite boring, looking at a meat grinder, at least after a while.

Also, if you are using only one meat grinder, you're kind of limited. What if you're a chef, and you'd like to make two different kinds of beefs? Perhaps you won't use the same meat grinder for lamb as for pork. The pork isn't as tender, and you'd like to mince it in finer pieces. Well, why not adjust the settings?

First, while dealing with the pork, you turn the knob to the settings to get finer pieces. Next, when you're doing the lamb, you change the settings again.

Mathematicians sometimes do the same thing with functions. For example, they might define a function which is when is negative, and when is positive. They use the first settings to prepare the pork. Then, as it's time to do the lamb, they change the settings. Here's how it might look like:

Appréciez-vous ce sujet ? Aidez-nous et partagez-le.

## Une application mathématique qui vous aide à réussir

Certains utilisent Elevri comme matériel supplémentaire pour leurs études. D'autres utilisent uniquement Elevri. Notre mission est d'inspirer, d'encadrer et de rendre les mathématiques claires.