Question
Honor Student
Posts: 2
Member Since: ‎02-28-2017
Message 1 of 9 (449 Views)

# how to solve an intergral equation of circular function with domain restrictions

Product Name: HP Prime
Operating System: Microsoft Windows 7 (32-bit)

how to solve an intergral equation of circular function with domain restrictions?

for example, find the value of b for the equation

int(cos(2x), 3*pi/4,b)=0.25, where 3*pi/4<b<5*pi/4

I enter:

solve(int(cos(2x), 3*pi/4,b)=0.25, b)|3*pi/4<b<5*pi/4

but the above HP Prime command did not work. Later I asked several Maths teachers, they did not know how to deal with them too.

How do we figure out it?

note: this question is from a VCE quesiton (Victoria certificate equation in australia)

Posts: 390
Member Since: ‎01-08-2009
Message 2 of 9 (410 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

[ Edited ]

Hello,

The CAS in Prime behaves more like all the "real" CAS systems out there. Namely, you make an assumption about a variable, then do the operation and continue working with those assumptions. Thus the "planned" way to do this is:

1.  make your assumption (note your variable needs to come first - it is "storing" the assumption into the variable).

assume( b>(3*π/4) AND b<(5*π/4))    <---  "3*pi/4<b" doesn't work because b is on the right - keep your variable to the "left" of the assumption

2. Now you have the assumptions stored, try your original input:

solve((int(cos(2*x),x,3*π/4,b)) = (1/4),b)

3. Out pops the expected result.

4. Note that you have assumptions stored in b, and they will remain until you remove them. To do so, run purge(b) and it will remove the assumption values stored on b.

I personally thought this was kind of strange and wonky at first. Then, I understood why it behaves this way. Using this method of making assumptions on variables allows much more powerful assumptions to be made and is why all the high power CAS systems follow the same type of methodology. You can do things like assume a variable is a specific object type (real, complex, member of a subset, etc) and other much more complex things that would just be very difficult to do in a single | statment.

In addition, you very often continue working with those restrictions on that variable as you continue working the problem. It kind of follows the way you would do a mathematical proof in some ways - you start applying assumptions about variables, and then work your way through the problem.

HOWEVER, you can do this in a single operation. If you really do want to make a temporary assumption, follow the same recommendations regarding your variables ONLY being on the left side. This will ALSO work:

(solve((int(cos(2*x),x,3*π/4,b)) = (1/4),b)|((b>(3*π/4)) AND (b<(5*π/4))))   <--- (note b in the | always appears to the left of the < or > or >= or <> and similar - don't put your variable on the right side)

Out pops the same result.

Feel free to ask some more questions if you get stuck! :-)

----------------------
TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Teacher
Posts: 96
Member Since: ‎09-23-2016
Message 3 of 9 (396 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

Tim_Wessman wrote:
You can do things like assume a variable is a specific object type (real, complex, member of a subset, etc) ....

That is interesting, Tim.

How do you assume that a variable is real?

Posts: 390
Member Since: ‎01-08-2009
Message 4 of 9 (389 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

Here's some examples of possible assumptions:

assume((a>=2 and a<4) or a>6)

assume(x,integer);

assume(x,complex);

The main 3 categories most applicable here are: "float", "integer", "complex".

Also, as a note to the original poster - I'm working with the CAS author regarding accepting things like 0<b directly rather then requiring it to be flipped, and also things like 0<b<2 or similar directly. That might be a possible future improvement that can be made. Thanks for the question!

----------------------
TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Teacher
Posts: 96
Member Since: ‎09-23-2016
Message 5 of 9 (362 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

Tim_Wessman wrote:

Here's some examples of possible assumptions:

assume((a>=2 and a<4) or a>6)

assume(x,integer);

assume(x,complex);

The main 3 categories most applicable here are: "float", "integer", "complex".

Thank you.

I see that the example:

assume(x,integer)

is given in the user manual but not in the built- in Help.

I found out that another way of writing is:

assume(x,2) or assume(x,DOM_INT) and that we can get the types by e.g.

type(3.56) which returns DOM_FLOAT.

Honor Student
Posts: 2
Member Since: ‎02-28-2017
Message 6 of 9 (329 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

Dear Tim,

thank you.

I have solved the question by inputing

command (1):  "assume( b>(3*π/4) AND b<(5*π/4))"

command (2)  "(solve((int(cos(2*x),x,3*π/4,b)) = (1/4),b)|((b>(3*π/4)) AND (b<(5*π/4)))) "

But if i change 1/4 into 0.25 in the command (2), then no solution is found, why?

Posts: 390
Member Since: ‎01-08-2009
Message 7 of 9 (320 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

That changes it from an exact, symbolic system into one that is "approximate" with non-exact numbers. Basically, keep decimals out of your symbolic calculations as that throws the CAS into a mode  where it will use numerical algorithmns and similar. Most CAS systems behave this way - it can be confusing to new users though.

----------------------
TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Teacher
Posts: 96
Member Since: ‎09-23-2016
Message 8 of 9 (302 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

Another way to solve the problem is thus:

Or:

So in the last example we entered the vector: [f=1/4,  3*pi/4<b,  b<5*pi/4]

Highlighted
Teacher
Posts: 96
Member Since: ‎09-23-2016
Message 9 of 9 (282 Views)

## Re: how to solve an intergral equation of circular function with domain restrictions

It is also possible to solve the problem numerically, and use 0.25 instead of ¼, but in that case we have to use fsolve instead of solve.

Then we get:

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation