assumptions in integrals' computation in programming mode - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: assumptions in integrals' computation in programming mode (/thread-19043.html) |
assumptions in integrals' computation in programming mode - robmio - 10-29-2022 11:07 AM Good morning, if I want to calculate the following integral: int((t-x)^(-1/2)*ln(x),x,0,t) it is necessary to make the following assumptions: assumes(t>0); additionally(t>x). My question is the following: how can I assign an assumption to a variable in #cas ... #end programming mode? See attachments Thanks a lot, Roberto (robmio) RE: assumptions in integrals' computation in programming mode - Ioncubekh - 10-29-2022 12:43 PM Code: assume(t>0 AND t>x) RE: assumptions in integrals' computation in programming mode - robmio - 10-29-2022 01:38 PM (10-29-2022 12:43 PM)Ioncubekh Wrote: Thank you for the answer, but my question is another: in which area of a program do I put the instruction "assume"? For example, in this "#cas ... #end" program: #cas cavolo():= BEGIN LOCAL fnz, Fnz; fnz:=(x)->(t-x)^(-1/2)*LN(x); Fnz:=(t)->int(fnz(x),x,0,t); RETURN Fnz(t); END; #end in which zone do I put "assume(...)"? Putting the "assume()" statement between the "fnz" statement and the "Fnz" statement, I get nothing. Thanks a lot, robmio RE: assumptions in integrals' computation in programming mode - robmio - 10-29-2022 02:07 PM (10-29-2022 12:43 PM)Ioncubekh Wrote: I solved the problem: #cas ... Fnz:=(t)->int((t-x)^(-1/2)*ln(x),x,0,assume(t>0 AND t>x)); ... #end It works! |