First time here? Check out the FAQ!

Ask Your Question
0

odd trig function behavior

asked 12 years ago

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?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 12 years ago

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

Thanks for the report.

Preview: (hide)
link
1

answered 12 years ago

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)')
Preview: (hide)
link

Comments

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

calc314 gravatar imagecalc314 ( 12 years ago )

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: 12 years ago

Seen: 477 times

Last updated: Oct 08 '12