solving trig equations

1,239 views
Skip to first unread message

Jimmy Fullerenex

unread,
May 2, 2011, 2:19:16 AM5/2/11
to Nspire Group
Hi everyone,
when I tried to solve an equation with trig and power, like solve(cos(t^2)=1/2,t)|0<t<pi  even though I put a constraint of t here, the solution still contains n1 or something (which in this problem there should be 3 exact solutions available in the domain)
Anyone can help? Thanks!
Cheers,
Jimmy Fullerenex

Nelson Sousa

unread,
May 2, 2011, 6:07:32 AM5/2/11
to tins...@googlegroups.com
try like solve(cos(t^2)=1/2 and t>0 and t<Pi,t)
The | operator imposes restrictions on the expression, namely when you
need to restrict a variable to stay within its domain. It influences
the way simplifications are carried away when evaluating the
expression, for example.

But that's not what you want. In fact you want to solve a system of 3
conditions, an equation and two inequalities.

Cheers,
Nelson

> --
> To post to this group, send email to tins...@googlegroups.com
> To unsubscribe send email to tinspire+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
> The tns documents shared by group members are archived at
> http://lafacroft.com/archive/nspire.php

Jimmy Fullerenex

unread,
May 2, 2011, 7:25:39 AM5/2/11
to tins...@googlegroups.com
Yes Nelson, I tried your method yet unfortunately the result turned out to be an even messier pile...
Is there a better way?
Cheers,
Jimmy Fullerenex



2011/5/2 Nelson Sousa <nso...@gmail.com>

Nelson Sousa

unread,
May 2, 2011, 11:40:28 AM5/2/11
to tins...@googlegroups.com
what are you getting?

Jimmy Fullerenex

unread,
May 2, 2011, 10:48:31 PM5/2/11
to tins...@googlegroups.com
Hi Nelson,
I've attached the screenshots. The two different inputs seem to get two different messes. :-)
Screen001.jpg
Screen003.jpg

Nelson Sousa

unread,
May 3, 2011, 6:13:13 PM5/3/11
to tins...@googlegroups.com
The difference between the two cases has to do with the
simplifications performed while solving the equation. Different
expressions use different algorithms. But the two answers should give
the same numerical results, regardless of the way they look.

As for the "mess":

n1, n2, ... represent arbitrary integer constants. For example,
solve(sin(x)=x,x) returns n1*Pi, which means all integer multiples of
Pi are solutions of the equation.

Restricting the domain of the equation limits the scope of those
constraints. But doesn't eliminate them. Nspire prefers to represent
solutions of trig equations with arbitrary integers instead of
displaying all possible values (which may be infinite).

Even with 0<t<Pi, you have more than one solution in each branch.
Check it out replacing n1, n2 or whatever constant was displayed by 0,
1, 2, -1, -2, etc. (negative values will return false)


Cheers,
Nelson

Jimmy Fullerenex

unread,
May 4, 2011, 1:26:51 AM5/4/11
to tins...@googlegroups.com
THX Nelson. So you mean that we can't ask TI to automatically locate the exact 3 solutions that the constraint is referring to? I've fully understood your method of obtaining solutions of interest manually.
Cheers,
Jimmy Fullerenex



2011/5/4 Nelson Sousa <nso...@gmail.com>

Wayne

unread,
May 5, 2011, 5:12:49 PM5/5/11
to tinspire
This may or may not help, but the Nspire can definitely locate the
exact 3 solutions, but you have to make the request in a two-step
process. First, ask for the solutions, with or without the
constraints:

solve(cos(t^(2))=((1)/(2)),t)

The response is:

t=((√(3*(6*n2+1)*π))/(3)) and 6*n2+1≥0 or t=((−√(3*(6*n2+1)*π))/(3))
and 6*n2+1≥0 or t=((√(3*(6*n2-1)*π))/(3)) and 6*n2-1≥0 or
t=((−√(3*(6*n2-1)*π))/(3)) and 6*n2-1≥0

The Nspire is providing 4 possible solutions for this problem. Think
of these as 4 sets of solutions, with the value of n2 defining the
individuals members of each set.

Now have the Nspire provide you with a (sub)set of each of the four
sets in the following way:

solnset1:=seq(when(6*n+1≥0 and 0<((√(3*(6*n+1)*π))/(3))<π,((√(3*(6*n
+1)*π))/(3)),"na","na"),n,−5,5)

The response is:

{"na","na","na","na","na",((√(3*π))/(3)),((√(21*π))/
(3)),"na","na","na","na"}. This set contains 2 of the three
solutions.

solnset2:=seq(when(6*n+1≥0 and 0<((−√(3*(6*n+1)*π))/(3))<π,((−√(3*(6*n
+1)*π))/(3)),"na","na"),n,−5,5)

The response is:

{"na","na","na","na","na","na","na","na","na","na","na"}. This set
contains none of the three solutions.

solnset3:=seq(when(6*n-1≥0 and 0<((√(3*(6*n-1)*π))/(3))<π,
((√(3*(6*n-1)*π))/(3)),"na","na"),n,−5,5)

The response is:

{"na","na","na","na","na","na",((√(15*π))/(3)),"na","na","na","na"}.
This set contains 1 of the three solutions.

solnset4:=seq(when(6*n-1≥0 and 0<((−√(3*(6*n-1)*π))/(3))<π,
((−√(3*(6*n-1)*π))/(3)),"na","na"),n,−5,5)

The response is:

{"na","na","na","na","na","na","na","na","na","na","na"}. This set
contains none of the three solutions.

When a larger subset is required, you can change the endpoints of the
sequence command. Check the reference manual for more info about
seq() and when() commands.

Sorry for all the code in the body of the email, but without being
able to upload files now, this was the easiest way I could find. (I
do not have the group content forwarded to my personal email.)

Wayne

On 4 May, 01:26, Jimmy Fullerenex <smoat...@gmail.com> wrote:
> THX Nelson. So you mean that we can't ask TI to automatically locate the
> exact 3 solutions that the constraint is referring to? I've fully understood
> your method of obtaining solutions of interest manually.
> Cheers,
> Jimmy Fullerenex
>
> 2011/5/4 Nelson Sousa <nso...@gmail.com>
>
>
>
> > The difference between the two cases has to do with the
> > simplifications performed while solving the equation. Different
> > expressions use different algorithms. But the two answers should give
> > the same numerical results, regardless of the way they look.
>
> > As for the "mess":
>
> > n1, n2, ... represent arbitrary integer constants. For example,
> > solve(sin(x)=x,x) returns n1*Pi, which means all integer multiples of
> > Pi are solutions of the equation.
>
> > Restricting the domain of the equation limits the scope of those
> > constraints. But doesn't eliminate them. Nspire prefers to represent
> > solutions of trig equations with arbitrary integers instead of
> > displaying all possible values (which may be infinite).
>
> > Even with 0<t<Pi, you have more than one solution in each branch.
> > Check it out replacing n1, n2 or whatever constant was displayed by 0,
> > 1, 2, -1, -2, etc. (negative values will return false)
>
> > Cheers,
> > Nelson
>
> > On Tue, May 3, 2011 at 03:48, Jimmy Fullerenex <smoat...@gmail.com> wrote:
> > > Hi Nelson,
> > > I've attached the screenshots. The two different inputs seem to get two
> > > different messes. :-)
> > > Cheers,
> > > Jimmy Fullerenex
>
> > > 2011/5/2 Nelson Sousa <nso...@gmail.com>
>
> > >> what are you getting?
>
> > >> On Mon, May 2, 2011 at 12:25, Jimmy Fullerenex <smoat...@gmail.com>
> > wrote:
> > >> > Yes Nelson, I tried your method yet unfortunately the result turned
> > out
> > >> > to
> > >> > be an even messier pile...
> > >> > Is there a better way?
> > >> > Cheers,
> > >> > Jimmy Fullerenex
>
> > >> > 2011/5/2 Nelson Sousa <nso...@gmail.com>
>
> > >> >> try like solve(cos(t^2)=1/2 and t>0 and t<Pi,t)
> > >> >> The | operator imposes restrictions on the expression, namely when
> > you
> > >> >> need to restrict a variable to stay within its domain. It influences
> > >> >> the way simplifications are carried away when evaluating the
> > >> >> expression, for example.
>
> > >> >> But that's not what you want. In fact you want to solve a system of 3
> > >> >> conditions, an equation and two inequalities.
>
> > >> >> Cheers,
> > >> >> Nelson
>
> > >> >> On Mon, May 2, 2011 at 07:19, Jimmy Fullerenex <smoat...@gmail.com>
> >http://lafacroft.com/archive/nspire.php- Hide quoted text -
>
> - Show quoted text -

Jimmy Fullerenex

unread,
May 5, 2011, 9:45:35 PM5/5/11
to tins...@googlegroups.com
THX Wayne. Perhaps I can write a program\function according to your algorithm (getting done the 4 subsets one by one can be laborious! and typos may well be present)
Cheers,
Jimmy Fullerenex



2011/5/6 Wayne <wayn...@thepaces.org>

Jimmy Fullerenex

unread,
May 5, 2011, 9:58:57 PM5/5/11
to tins...@googlegroups.com
Strange as it is, for trig equations like solve(cos(x^3)=1/2,x)|0<x<pi 
solve(cos(4x+1)=1/3,x)|0<x<2pi    the Nspire returns satisfactory results.
But when the expression within trig is quadratic or radical, such like
solve(cos(4x^2+1)=1/3,x)|0<x<2pi  where the restraint seems to be no use, and:
 solve(cos(sqrt(x)=1/2),x)|0<x<2pi where the result contains exact solution x=(pi^2)/9 and a pile of unnecessary conditions like 6n14 -1>0
It seems that the solution sets of trig equations are quite unpredictable, depending on the specific style.
Cheers,
Jimmy Fullerenex

Nelson Sousa

unread,
May 6, 2011, 6:08:00 AM5/6/11
to tins...@googlegroups.com
The thing is that for quadratic equations the CAS determines both
solutions in general, whereas for higher degree it resorts to
numerical methods.

Nelson

Jimmy Fullerenex

unread,
May 6, 2011, 6:51:37 AM5/6/11
to tins...@googlegroups.com
Not really. Calculate solve(cos(x^3)=1/2,x)|0<x<pi  and  solve(cos(4x+1)=1/3,x)|0<x<2pi  under exact mode, and Nspire returns several exact solutions with cubic roots and rationals perfectly. Yet even in approximate mode, solve(cos(x^2)=1/2,x))|0<x<pi  yields a mess like x=-2.5066*sqrt(n2+0.16667)... The pattern of solution set seems to depend heavily on input form. As a reasonable comparison, I guess Nspire uses very different algorithms for quadratic, cubic, radicals and rationals even within similar trig expressions. Maybe in this part Nspire Cas needs further upgrade. (one of my classmates reported no such error with her Casio CAS)
Cheers,
Jimmy Fullerenex



2011/5/6 Nelson Sousa <nso...@gmail.com>

Nelson Sousa

unread,
May 6, 2011, 7:09:53 AM5/6/11
to tins...@googlegroups.com
some higher degree equations can be solved exactly. Some, not all.
(well, stricly speaking all 3rd and 4th degree equations can be solved
exactly, a general formula exists, but it's not implemented on Nspire
CAS). If a full and exact solution can be found it'll use it,
otherwise it'll resort to numerical solutions. Exact solution will
have the arbitrary constants, approximate solutions most likely will
not.

But, going back to what you consider "a mess": how do you represent
the set of solutions of equation sin(x)=1/2?

Nelson

Jimmy Fullerenex

unread,
May 6, 2011, 7:22:10 AM5/6/11
to tins...@googlegroups.com
No Nelson, a little misunderstanding... I know arbitrary constant n1 c1 or something represents a general formula for the solution set. Yet what I mean is not about exactness or not; my point is that under a specific constraint with both endpoints, Nspire should, at least theoretically, return a finite set of solutions. I mean a "mess" because Nspire returns a general formula while specific solutions should instead be located. What I find exceptionally peculiar is that under some circumstances it does (solve(cos(x^3)=1/2,x)|0<x<pi   solve(cos(4x+1)=1/3,x)|0<x<2pi   etc.), while under other situations it does not.(solve(cos(x^2)=1/2,x))|0<x<pi  ) I know there's something wrong with the algorithm because, like I said, I consulted the result of a Casio brand CAS.  ;-)
Reply all
Reply to author
Forward
0 new messages