2. Quadratic function

In this chapter, we look at two examples from everyday life, each involving a quadratic function. They will make us familiar with this feature, which will come in handy in later chapters.

Nazzeni pica

Regular restaurants sell multiple-size pizzas. For example, in one unnamed pizza, an olive pizza 32 cm in diameter costs 120 k\u010d and a larger pizza 45 cm in diameter already costs 195 k\u010d. Rapid numbers say that an increase in the radius of about a third resulted in an increase in the price of about half. But is that a fair assessment?

A relationship for the square's content using its edge can even be considered a definition of content. Any more complex shape would then consist of small squares (like pixels on a computer). We will return to that idea.

You may want to say that the restaurant charges too much, but that would be too hot-headed a condemnation. We pay for the pizza's contents, not its radius. And before that, I've listed the growth in its average, not its content. So let's calculate the content. Everybody knows that the square's content on the $a$ side is equal to $S=a^2$. Similarly, the contents of a $a$ circle should be larger the larger the $a$, and should even be directly proportional to the $a^2$. The contents of the circle are so $S_k=K\cdot and^2$, where $K$ is some unknown constant.





The edge of the smaller square can be calculated from the Pythagorean theorem if one realizes that the diagonal of the smaller square is $2a$.

From the figure above, we can see that the contents of a $a$ radius circle should be less than the square's contents of $2a$, that is $S_v=4a^2$, but larger than the square's contents of $\sqrt{2}and$, that is $S_m=2a^2$. That's $4>K>2. I won't drag it out any longer, because you may have already guessed that $K$ is the familiar number $\pi \approx 3,141\,59$ (the Greek letter pi). The more precise values of Pi can be obtained by measurement, or if we use five-, six- or multi-angles instead of inscribed and circumscribed squares. Using the geometry method of $n$-angles, he used pi, for example, Archim\u00e9d\u00e9s, to calculate decimal digits.

So in this short digression, we found that the contents of the circle (and thus of the pizza) are proportional to the square of the radius (and therefore the diameter). The price, in turn, should be proportional to the content (the bigger the content, the bigger the price), which in turn should be proportional to the square of the pizza's radius, i.e. $\text{price}=K\cdot r^2$, where $K$ is a constant again and $r$ is a radius. The first pizza comes with $K_1 \approx 0.47\,\text{k\u010d/cm}^2$, and the second comes with $K_2\approx 0.39\,\text{k\u010d/cm}^2$, so the pizza industry seems to favor large pizzas, a common business strategy.

More efficient price comparison

The previous price comparison gave us some information, but the calculation was a little uncomfortable and unnatural. Moreover, if a pizzeria sold more pizza sizes, it would be quite difficult to navigate. Luckily, mathematicians have devised a mathematical object called a function to help us make sense of the world of pizzerias. Let's explain the function definition in the pizza example.

Required dose of mathematical definitions

We normally denote functions $f(x)$ and read f from x\ or the function f of x. In our case, we might, for example, want to construct a pizza price function depending on the radius. Let's call it $f$ again, but we're going to write $f(r)$ this time because we're describing a function depending on the $r$ radius. Such a function is strictly speaking a representation between two sets. In our case, we have the set of $R$, which is the set of possible pizza radii, and the set of $C$, which is the set of possible pizza prices. Then we write $f:R \to C$, which means that the function assigns a price to the possible radii of how much the pizza would cost.

But what key does the feature assign a price to radii? Let's say if a pizza has a radius of $r$, the corresponding price will be $c=K_1\cdot r^2$ as if the pricing of the first pizza from the example above applies to all pizzas. Then we write $f: r \mapsto c$, i.e. that the $f$ function works by assigning a specific $c$ to a specific $r$ (note that I used a different kind of arrow, plus $R$ is a set and $r$ is an element of a set). Another way to write the same is $f(r) = K_1\cdot r^2$ (this is called a function prescription). It's also important that the function assigns just one prize to one radius.

The radius of $r$ that we can give the function is called a variable, and the number $f(r)$ that the function returns to $r$ is called a functional value. But we don't have to mark the function $f$ and the radius might not be the only variable. Normal is the function $g(x)$, which is the function of the $g$ variable $x$.

You probably already knew the functions before reading this article, however, I defined them fundamentally in full view largely because of the comment in this paragraph. Similar thoughts will be repeated later when we talk about the derivative of the function [at the point].

Now comes a bit of a trick question, because you might ask what the letter $r$ means in the expression $f(r) = K_1\cdot r^2$. Sometimes it can mean any $r$ of a set of possible $R$ radii, sometimes it can mean one particular, fixed $r$ of $R$. Therefore, even $f(r)$ can mean sometimes a function, and sometimes a number, that we get when a function assigns a $r$ radius price. Occasionally, one particular $r$ is marked as $r_0$, but this is not the norm, one has to be careful what is ever meant by it (we estimate from the context).

But what does it all mean?

The functions will show their usefulness if we plot them on a graph. Functions such as views between two sets show the relationship that exists between those sets, and are often best seen in the chart. So let's look at the graph of the $f(r)$ function that we described above.





The curve in the chart shows a set of points with coordinates $[r,c]$, corresponding to the radius of $r$ pizza and the price of $c$. It also highlights a point directly corresponding to the first pizza and a point corresponding to the second pizza. Consider that since the second point lies below the curve, the second pizza is comparatively cheaper than the first if prices would depend only on the pizza content and the first would be taken as the reference point. When we have a graph like this, we can also, for example, test different pricing of different sizes of pizzas, or construct a simple menu to make prices fair.

So when you say function, imagine some graph with a curve. The curve is a function that describes how some

Cloudy

If we were to draw a function of the temperature or price of goods in a year, we could draw points on a graph, but we probably couldn't write a prescription for the points drawn. Not every function has a prescription, but every function has a graph. Unfortunately (or fortunately) there are functions that have a graph but are hard to draw, like Dirichlet function $D(x)$, which is equal to $1 if $x$ is rational, and $0$ other times. E.g. $D(1)=1$, but $D(\pi)=0$.

So the functions are important because they can represent the relationships that we observe around us, and we can analyze them better. For example, a temperature function is normally constructed during the day (i.e., the $T(\tau)$ function, where $T$ is the temperature and $\tau$ is the time) and we observe which part of the day is the warmest. Or, for example, we monitor the price of goods over the course of a year and find out when people are most likely to buy them. Or we also draw the speed function of a car based on time to see when it's going to give us the biggest jolt.

So we can use functions as a pure representation of the relationship of two variables. But let us see how to analyse this relationship in more detail, while answering the question How is it that so few times I am in the rain but manage to come out of it?\ Personally, I have never once been on the edge of the rain, i.e. rained on my left hand, but not on my right. Every time it pours, I look forward to maybe standing in the dry and looking at people getting wet, but nothing yet. But it should happen at some point, so why?

So we ask: If it's raining, why is it that I almost never happen to be on the edge of the rain?\ He helps himself to draw a picture of a city with a rain cloud over the top.





In a somewhat schematic image, I represented Prague as a square and a cloud as a sphere. Suppose, then, that we are first in some random place in Prague, and suddenly there is a rain cloud over the city, from which it starts to rain. There are three things that can happen. I'm either outside the rain, or in the rain, or on the rain's edge. If we're outside the rain, it doesn't matter, because we ask about when it's raining (that is, we have to notice that it's raining, and we don't notice that when we're outside the rain). The other two possibilities are more interesting. If we calculate the probability that we're at the rain/rain interface, then we can divide these two probabilities and figure out how many times one or the other is more likely. That should give us the answer to the question.

Since we're not interested in cases outside of rain, it doesn't matter that I drew Prague as a square. Clouds, however, typically do not have the outline of a circle. But let's assume that it does, it shouldn't matter in the other calculations. Since it's just as likely to be in any location in Prague, it's enough to calculate the ratio of zone contents in rain and on the edge for the probability ratio. That's what the cloud's circular shape will help us do-it's easy to count the contents. So let's say our cloud has a radius of $r$. Then the content inside the cloud (the gray area in the picture) is equal to $$ S_u = \pi r^2\,. $$

In contrast, if we're on the edge of the rain, we have to be somewhere around $r$ distance from the center of the cloud. Suppose a person can see the furthest $r_0=50\,\mathrm{m}$, then we have to be the farthest $r_0$ from the edge. The circle circumference is long $o=2\pi\cdot r$. We can think of the cloud edge area as a radius that we stretch and draw a rectangle around it that's $2r_0$, that's how we estimate the size of the rain edge content.





The rain margin content is so equal $$S_o= 2\pi r\cdot r_0 \,.$$

Now the question arises: which of the contents is bigger, and by how much? Let's graph both of them.





So we see that for clouds with a radius of $100\,\mathrm{m}$, the content of the interface is the same as the content of the cloud's interior. But when the cloud gets bigger, the interface gets smaller relative to the interior, if I were to scale down the scale in the graph, which would show that the content of the interface becomes negligible. We can calculate the interface/interior ratio for a small rain cloud with a radius of one kilometer. We will $$\frac{S_o}{S_u}(1\,\mathrm{km}) = \frac{1\,\mathrm{km}}{100\,\mathrm{m}} = 1/10 \,. $$

That's a pretty slim probability. It would be even smaller and close to zero for the larger clouds we tend to encounter (you can even try to plot a graph of the probability function $p(r)=r/(2\cdot r_0)$). Combined with the fact that it doesn't rain as often, we therefore get an explanation as to why it never happens that you're half in the rain. There's simply less chance of us being below the edge than below the inside.

Quadratic function

The $f(r)=r^2$, which we encountered in the two examples above, is called the quadratic function by telling us what the square of the $r$ edge has. We'll study it in more detail, however, let's talk about $f(x)=x^2$, because that's more common in math.

We don't have to go far for the meaning of the word, e.g. in German the square is said das Quadrat. The word square also comes from the word square, meaning the calculation of content by dividing it into tiny squares (pixels). This method is widely used in today's computer science and is based on differential calculus. In the past, the problem of square circles, or the creation of a square with the same content as a $1 radius circle using a ruler and a compass, was still known. But there is no solution to this problem, perhaps that's why, according to people trying to solve the mystery, the term moron has become hard to square.

Growth of quadratic function

In the cloud example, and often at other times, it's important to know how quickly functions grow. So let's look at the growth of the quadratic function, let's write down some of its values.



---------------------------------------------------------
x    | 0 | 1 | 2 | 3 | 4  | ... | 11  | 12  | 13  | 14
---------------------------------------------------------
f(x) | 0 | 1 | 4 | 9 | 16 | ... | 121 | 144 | 169 | 196
---------------------------------------------------------

Can you figure out how to, for example, use $f(13)$ to figure out $f(14)$ for the $13 number?

If you think about it for a while, you'll think $f(14)=f(13)+13+13+1$. The same goes for all other natural numbers, try it. Why is that? The rationale can be found in geometry. Let's draw a square with an edge of $5$ units and try to increase it by one unit.





The same session applies to all real numbers $x$, just multiply $(x+1)^2$.

We see that by increasing by one row, the contents have increased by $2\cdot 5+1$. Similarly, we can argue for all other natural numbers. It therefore applies to them: $$f(x+1) = f(x)+2x+1\,.$$

From this equality, we can see something about the function $f(x)=x^2$. If we (a little vaguely) define growth as how much the functional value changes when we change its argument,\ we'll see that the growth in the $f(x)$ function is like $2x$, so the bigger the $x$, the more it grows. In contrast, the linear function $f(x)=k\cdot x$ pays $f(x+1)=k$, so this function keeps growing the same. No wonder, then, that the quadratic function outgrows the linear. So the lesson about the cloud makes the following, new sense: its content grows faster than its circumference, and thus, with more content, we are less and less likely to be near its circumference. Thoughts about function growth are probably pretty new to you, and you need to get used to them. Yet they form the core of what we will deal with in the next chapters and what I find interesting. So don't worry, if everything hasn't been understood, we'll still be on this topic. But then we'll talk about it more formally and call it a function derivative instead of a growth.

<< Previous chapter >> Next chapter