Abstract

A scientific calculator is a device that computes functions such as $\exp$, $\cos$, and $\sin$. An electronic calculator is designed by using basic arithmetic operations like $+, -, \times, \div$. So we will simulate the functionality of the scientific calculator by using GO Language, one of several programming languages.

Keywords

Differentiation, Derivative, Exp, Cos, Sin, Taylor’s theorem, Taylor series, Series, Power series, Limit, Continuity, Radius of convergence, Analytic function

Table of Contents

1. Introduction

A scientific calculator is an electronic device that computes formulas including important transcendental functions such as $\exp$, $\cos$, and $\sin$. For instance, a typical scientific calculator looks like the following image.

From Coupang.com

From Coupang.com

The values in the screen of the calculator show us an approximate value of a formula that you entered in it. This value can be computed by Taylor’s theorem, which is one of the most famous formulas in Calculus.

What are the functions like $\exp$, $\cos$, and $\sin$? And why should we know about these? These days, in real life, the exponential function is widely used in a variety of fields; Science, Engineering, Economics and etc. For example, we use it when we compute the interests of saving in a bank account. Also, in the process of radioactive decay, the number of unstable nuclei of atoms decreases following the exponential function. How about trigonometrical functions? They are useful in fields of Astronomy, Acoustics, Ecology, Surveying, and so on. For instance, when we analyze sound waves to develop musical instruments, we need to use the functions such as $\sin$ and $\cos$.

We need a calculator or a computer especially to compute values of the transcendental function since it is too hard to calculate them by hand.

GO language (developed by Google in Nov. 2009) is one of the programming languages. It is created by mainly 3 people; Robert Griesemer, Rob Pike, and Kenneth Lane Thompson. They invented this language because they want to make simpler and more intuitive language than C++ language. When we learn GO lang, we can find it’s been affected by C language due to Thompson; one of the inventors of C lang.

Then, why should we use GO lang to program a calculator in this project? It is one of the compiled languages, however, its compiling speed is far faster than the others’ like interpreted languages. And it is a very simple and practical language. In particular, it has only 25 keywords to program something; much less the number of those of the others. That is, it’s a very good language to start learning and to handle. Of course, there are some disadvantages when we use GO lang, but due to the advantages, there are quite many users using GO lang.

We will use Visual Studio Code, one of the source code editors, to use GO lang. Firstly, we will check the backgrounds of the Taylor series so that we can apply it to codes. And then for convenience to program, we will divide two parts of the calculator. The first part will be an input part for getting two values from users; selecting a function among $\exp(x), \cos(x)$, and $\sin(x)$, and then $x$ from users. The second part will be a calculation part with the input values from the users. With the combination of them, we will be able to compute the approximation values easily.

2. Background

In this section, we will introduce mathematical concepts that are related to the approximation of the transcendental functions by using their Taylor series. In [2-1], we will deal with the definitions of limits, continuity, and derivative. In [2-2], we will introduce important transcendental functions; $\exp$, $\cos$, and $\sin$. In [2-3], we will introduce the definition and properties of the power series.