Ask Your Question
0

odd trig function behavior

asked 2012-10-08 14:35:55 +0100

calc314 gravatar image

I get different behavior for trig functions at poles depending on how I evaluate them. For example:

f(x)=tan(x)^2-tan(x)
f(pi/2)

gives 0, which is disturbing.

Yet

f(x)=tan(x)*(tan(x)-1)
f(pi/2)

gives Infinity.

And,

tan(pi/2)^2-tan(pi/2)

gives

Infinity.

What's going on here?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-10-08 15:10:54 +0100

This is a bug in Pynac. I opened a ticket on trac (#13587).

Thanks for the report.

edit flag offensive delete link more
1

answered 2012-10-08 18:39:25 +0100

achrzesz gravatar image

Maxima behaves better:

sage: maxima('f(x):=tan(x)^2-tan(x)')
sage: maxima('f(%pi/2)')
....
....
....
Maxima ERROR:

tan: %pi/2 isn't in the domain of tan.

# the same error messages in:
sage: maxima('f(x):=tan(x)*(tan(x)-1)')
sage: maxima('f(%pi/2)')          
sage: maxima('tan(%pi/2)^2-tan(%pi/2)')
edit flag offensive delete link more

Comments

I agree. I prefer that behavior rather than returning infinity.

calc314 gravatar imagecalc314 ( 2012-10-08 19:59:41 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-10-08 14:35:55 +0100

Seen: 424 times

Last updated: Oct 08 '12