• ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
HP Prime
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)

 

 

8 REPLIES 8
HP Recommended

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 as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

@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?

 

 

 

HP Recommended

Here's some examples of possible assumptions:

 

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

assume(x>0); additionally(x,float);

assume(x,integer);

assume(x,complex);

 

 

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

 

 

about(x) would return the assumptions made about x currently.

 

 

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 as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

@Tim_Wessman wrote:

Here's some examples of possible assumptions:

 

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

assume(x>0); additionally(x,float);

assume(x,integer);

assume(x,complex);

 

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

 

about(x) would return the assumptions made about x currently.

 


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.

 

HP Recommended

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?

HP Recommended

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 as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

Another way to solve the problem is thus:

 

2017-03-06 16.03.10.jpg

 

 

Or:

2017-03-06 16.07.06.jpg

 

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

HP Recommended

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:

 

2017-03-07 13.55.09.jpg

Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.