
CAS with Geogebra
or, What's my radius?
Geogebra is a great tool for working with geometric objects, but it also has a computer algebra system (CAS) built in. There are other more capable computer algebra systems such as wxMaxima and Wolfram Language, but this might work for solving a simple algebraic-geometry problem.
Here’s the problem to solve: A circle touches the function in two places, the origin and one other point. What’s the radius of the circle?

Circle radius problem.
At the two points where the circle touches the function, lines perpendicular to the tangents and drawn from those two points will intersect at the center of the circle. What’s a tangent? Imagine a straight line that just touches the function at one point, and has the same slope that the function has at that point. To calculate the slope we need to find the derivative of the function.
The derivative
The derivative of a function is defined as where
What this means is that you should choose some small number and calculate the value of the function at the point but shifted by , and then subtract the value of , or the change in values. Divide by the difference in the values, which is to give the rise over the run, or the slope of the function at the point .

Calcluating the derivative.
Now, let the step shrink down to practically nothing and see what the rise over the run is for to get the slope of the function at a point, which is also the derivative of the function. Let’s see how this works for the cubic function .
In the first line, we just substituted for in the function, subtracted and divided the whole thing by . The second line is the same, but with the cubic term expanded, and in the third line we subtract from which cancels out the term everywhere, leaving only terms that have in them.
In the fourth line, we divide by which leaves two terms without , and two with. Finally, taking the limit as gets close to zero, the last two terms become zero leaving only .
If you want Geogebra to do the expansion of , use Expand((x+d)^3)
and remember that is being used in place of .
In Geogebra, define the function which draws the green curve. Let the Geogebra CAS calculate the derivative, which it calls and draws as the orange curve. At the origin, and the orange curve reaches a maximum of one at that point. This means that a line tangent to at the origin has a slope of one, so for every unit change along the axis there’s an equal unit rise along the axis, which is shown in the light gray dotted line.

The function, derivative, tangent and perpendicular.
Two lines are perpendicular to each other if their slopes are negative inverses of each other. We often use the letter to denote the slope of a line, so the tangent at has slope , and a perpendicular will have slope . The perpendicular through the origin is shown in the darker dotted line.
Defining the problem
The center of the circle is somewhere on the line and the distance from the center to the two points of contact with the function is the radius, . We need to find the point that represents the second point on the circle and the function.

The center of the circle.
Since is on the line , then the coordinates of are and distance from to the origin is . The point has coordinates and the slope of the perpendicular through is
The equation of a line through with slope is
Substituting for the slope ,
and then for ,
At the point of intersection equals which is so the equation becomes
Since there are two unknowns, and we’ll need another equation, which is the equation for the radius. Using the Pythagorean theorem,
Squaring both sides,
Now we have two equations and two unknowns, so we should be able to find a solution. Finding a closed form, or analytic solution is probably not possible, so we may have to settle for a numerical approximation.
The Geogebra solution
To solve the two equations simultaneously, enter the following in Geogebra:

The Geogebra solution.
and it gives a solution where both and are at the origin. In this case, the radius is zero, but obviously there’s another solution where .
The wxMaxima solution
The Geogebra CAS wasn’t able to provide a second solution for the point , but with a bit of rearrangement of the equations, wxMaxima found a solution for . Besides the cubic equation and the derivative , the equation for a line perpendicular to at any point can be defined as
which is the form for a line. With this, we can define the line through the origin as which intersects the line through the point at the point . The distances from to the origin and to are the radius of the circle which we can define as
In both, we didn’t take square roots but will require that they are equal (and equal to ). For , the distance is from the point to the origin, so we’re effectively subtracting from both the and terms. In the second equation, is the distance from to some point on the cubic function. The coordinates of are and the coordinates for are .
Entering these equations into wxMaxima and then asking for a solution gives this result:

The wxMaxima solution.
There are two real roots to the problem from symmetry because the circle could have been flipped about the line , which is why is shown as a negative number here. Numerically, , and the radius of the circle is .
So, the Geogebra CAS wasn’t able to find two solutions, but the wxMaxima CAS found . Notice that the solution for contains , meaning that the point lies in the complex plane. Since the equation is a high order polynomial and there are only three real solutions, we should expect the remaining solutions to be complex. (In fact, there are four real solutions because the point at the origin is included in both the positive and negative solutions for .)
We’ll leave this problem here, but you could continue the exploration by finding the area of the circle, and the solution for .

Software
- Geogebra - GeoGebra is dynamic mathematics software for all levels of education that brings together geometry, algebra, spreadsheets, graphing, statistics and calculus in one easy-to-use package.
- Wolfram Language - Wolfram Language is a symbolic language, deliberately designed with the breadth and unity needed to develop powerful programs quickly.
Image credits
- Hero: Spiral illusion is enough to give you a headache — here’s why, Natalie Wolchover, NBC News Sept. 11, 2012.
- Curiosity Cats: Far Side, Gary Larson.