A Look at KDE’s KAlgebra

KAlgebra logo

Many of the programs I've covered in the past have have been desktop-environment-agnostic—all they required was some sort of graphical display running. This article looks at one of the programs available in the KDE desktop environment, KAlgebra.

You can use your distribution's package management system to install it, or you can use Discover, KDE's package manager. After it's installed, you can start it from the command line or the launch menu.

When you first start KAlgebra, you get a blank slate to start doing calculations.

Figure 1. When you start KAlgebra, you get a blank canvas for doing calculations.

The screen layout is a large main pane where all of the calculations and their results are displayed. At the top of this pane are four tabs: Calculator, 2D Graph, 3D Graph and Dictionary. There's also a smaller pane on the right-hand side used for different purposes for each tab.

In the calculator tab, the side pane gives a list of variables, including predefined variables for things like pi or euler, available when you start your new session. You can add new variables with the following syntax:


a := 3

This creates a new variable named a with an initial value of 3. This new variable also will be visible in the list on the right-hand side. Using these variables is as easy as executing them. For example, you can double it with the following:


a * 2

There is a special variable called ans that you can use to get the result from your most recent calculation. All of the standard mathematical operators are available for doing calculations.

Figure 2. KAlgebra lets you create your own variables and functions for even more complex calculations.

There's also a complete set of functions for doing more complex calculations, such as trigonometric functions, mathematical functions like absolute value or floor, and even calculus functions like finding the derivative. For instance, the following lets you find the sine of 45 degrees:


sin(45)

You also can define your own functions using the lambda operator ->. If you want to create a function that calculates cubes, you could do this:


x -> x^3

This is pretty hard to use, so you may want to assign it to a variable name:


cube := x -> x^3

You then can use it just like any other function, and it also shows up in the list of variables on the right-hand side pane.