1
$\begingroup$

I'm the author of application for android called Calculator++ One of the users submitted a bug in the integration of trigonometric functions. And I'm absolutely disagree with him.

In my app I use approach to calculate trigonometric functions differently in different modes (I mean DEG/RAD modes), e.g.:

  • in rad mode you can type $\sin(\pi/ 3)$ and get result $0.866$
  • in deg mode you type \sin(60°) (≡ sin(60)) and get the same result

So, strictly speaking in different modes I've got different sin functions - in deg it is a function of degree argument and in rad mode - function of radian argument.

Calculator++ allows to get the integral of sin function and in both modes: $\int\sin(x)dx = - \cos(x)$

And here is the misunderstanding: user says that correct integration formula is:

  1. RAD: $\int\sin(x)dx = - \cos(x)$
  2. DEG: $\int\sin(x)dx = - \pi / 180 \times \cos(x)$ (user assumes that variable modification is needed for correct integration)

I want to ask who is correct in this argument - me or user?

  • 0
    The main difference is in the result functions: 1. In the first case we get cos_d(d) which is function of degrees, and can continue to use degrees (we are in deg mode) 2. In the second case we get cos(r) which is functions of radians, and continue to use only radians (but we are use degree mode)2012-01-10

2 Answers 2

3

I don't think there's right or wrong there; it depends on how you describe what the trigonometric functions and the integration are supposed to do. Oddly, I would a priori tend towards your viewpoint, but based on your statement "strictly speaking in different modes I've got different sin functions" and on your equation "sin(60°) (≡ sin(60))", I'd say the user has a point: If you really do consider these as different functions, then clearly these different functions have different derivatives and anti-derivatives. (Speaking of anti-derivatives, both of your options are wrong since they're missing the integration constant.)

However, it seems to me that the most natural view isn't that these are two different functions (one of which never appears anywhere in mathematics), but that the same function is being applied to the same argument, just expressed in different units. Thus, I wouldn't drop the $^\circ$ symbol, but would consistently use it to denote an angle unit of $\pi/180$. Then the DEG mode would correspond to always implicitly adding a degree symbol to the current number before applying a trigonometric function. Then you have just one function, and the integral of that function is of course the one you give in your first option (plus a constant).

  • 0
    @F$a$$b$i$a$n: Thank you, I've understood the pro$b$lem.2012-01-11
0

The user is right in one respect: the approach you chose is inherently inconsistent. However, this inconsistency is a lesser evil and doubling the function definitions and the corresponding differentiation and integration rules would be a greater evil.

The usual convention in pure mathematics is that there is only one $\sin$ function and the degree ${}^\circ$ is just an abbreviation for "times $\frac{\pi}{180}$". So, you can input the argument in degrees and get output in degrees if you desire so but that's it. All processing is done in radians. From this point of view, Fabian's objection gets resolved pretty easily: the base is not $90$, but $90^\circ$, which is the same old $\pi/2$ though, of course, the integral has to be set up and displayed as $\int_0^{90^\circ}$, not merely as $\int_0^{90}$. Also writing $\sin 90=1$ is a bad mistake but writing $\sin 90^\circ=1$ is totally fine.

If you try to do calculus differently in different modes, everything will become so confusing that the only thing your calculator will be good for will be "making a satisfactory thump when dropped to the floor". Half of the student's computational mistakes when using calculators in the low-level trigonometry classes already come from forgetting which mode they are in (and no, that tiny squiggly indicator in the corner of the screen or whatever else you have in your application now doesn't help much) and nothing good will happen if you spread this dual interpretation elsewhere. I would really hate to lecture that "the series $\sum_{k=1}^\infty\frac{\cos 2\pi k}{k}$ diverges in the radian mode but converges in the degree mode" when teaching elementary analysis. I'd rather say "Those calculator designers went completely nuts, so bringing any kind of calculator to my class will cost you ten points deducted from your grade for each offense" instead.

A really good thing to do would be to dispose of that special degree mode altogether and have that ${}^\circ$ sign displayed after every number entered in degrees and force the user to push the corresponding ${}^\circ$ button at the process of entering each argument if he wants to work in degrees for angular computations. Unfortunately, that degree mode is very popular on the market, so that may be not an option.

Finally, if the user is so clever that he understands the inconsistency of the degree mode, he should be clever enough to be able to do everything in the radian mode without ever using the degree one, so I see no real reason for him to be unhappy.

  • 0
    Thank you for a good answer.2012-01-11