# HP Forums

Full Version: testing ibpdv and ibpu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all,
I'm testing the "integration by parts" in the Prime.
Inputting ibpu(x*sin(x),x) I get [-x*cos(x) cos(x)], ok
with ibpdv(x*sin(x),sin(x) I get [x*sin(x)^2/cos(x) (-x*sin(x)^3-cos(x)*sin(x)^2-x*cos(x)^2)/cos(x)^2]
I'm a bit confused: shouldn't I get the same result as above? Am I using wrong syntax? :-)

Then another question: there is also a "integration by substitution" method in the Prime?

thank you
Salvo
The second argument of ibpdv should be the antiderivative of one term in the product.
(05-12-2015 02:44 PM)parisse Wrote: [ -> ]The second argument of ibpdv should be the antiderivative of one term in the product.

thank you!
in fact, doing so it works well!

ibpdv(x*sin(x),-cos(x) -> [-x*cos(x) cos(x)]

Salvo
Hey Salvo,
as to the integration by substitution, take a look here:

Aries
(05-12-2015 07:45 PM)Aries Wrote: [ -> ]Hey Salvo,
as to the integration by substitution, take a look here:

Aries

thank you, Aries!

$\int_0^1{\sqrt{1-x^{2}}}dx$
assume(u>0); a:=subst('integrate(sqrt(1-x^2)),0,1,x)',x=sin(u)); a;
and I get [u, π/4 π/4]
Manually I have solution = (½)arcsin1 = π/4 (only?)
Is it right?
I thought to have this series: ∫cos(u)^2du, then (u/2)+(sin(2u))/4+c and finally (½)(arcsin(x)+x*sqrt(1-x^2)+c (changing also the integral bounds) ...

However it's interesting this approach.

Salvo
Hello Salvo,
as I am fairly new to the Prime I spend a lot of time trying it, so I entered your Integration example and got the list :[u, int(sqrt(1-sin(u)^2)*cos(u),u,0,PI/2),PI/4].
This is: [substitution var, new integral, result], your solution is only shown after a final hit on simplify. The list is produced because you are entering three commands in one line. So :simplify(subst('int(sqrt(1-x^2),x,0,1)',x=sin(u))) directly produces nothing but PI/4.
Now I tried int(sqrt(1-x^2),x) to see what the Prime would deliver: the answer is too long to be typed here,containing i and LN aside the first part, I thought of getting:0.5*(x*sqrt(1-x^2)+arcsin(x)).
So I entered: assume(x,float) and gave it a try, no change, I added: additionally(x>=0), still no change. By the way, Complex is switched off.
Perhaps you or someone else can give it a try.
Thanks,
Arno
edit: I now took the real Prime and entered the integral which clearly produced the same result, xcas on my Computer, xcas pad on my mobile and my formerly preferred cas (MathStudio for Android) delivered the simplified answer, which you provided and I had expected. I am a bit disappointed...
(05-12-2015 07:59 PM)salvomic Wrote: [ -> ]I'm reading it and trying
$\int_0^1{\sqrt{1-x^{2}}}dx$
assume(u>0); a:=subst('integrate(sqrt(1-x^2)),0,1,x)',x=sin(u)); a;
It should be
assume(u>0); a:=subst('integrate(sqrt(1-x^2),x,0,1)',x=sin(u)); a
(05-12-2015 10:18 PM)Arno K Wrote: [ -> ]...
So :simplify(subst('int(sqrt(1-x^2),x,0,1)',x=sin(u))) directly produces nothing but PI/4.
Now I tried int(sqrt(1-x^2),x) to see what the Prime would deliver: the answer is too long to be typed here,containing i and LN aside the first part,
...
I am a bit disappointed...

(05-13-2015 05:14 AM)parisse Wrote: [ -> ]It should be
assume(u>0); a:=subst('integrate(sqrt(1-x^2),x,0,1)',x=sin(u)); a

thank you Parisse!
iw would be interesting also to have a method to get "step by step" solution, here and for the "integration by parts" functions, but anyway still already this is ok...

Arno,
please, control your CAS Settings: I've in CAS: Exact, "Use √" and Principal checked, Complex not checked (with firmware 6975)
with the integral you should get (½)*ASIN(x)+(½)*x*√(-x^2-1) from 0 to 1, that's π/4 (in Home you gets 0.785398...)

try, and let me know...

Salvo
Yes, the bounded integral is no problem, the one I tried later , int(sqrt(1-x^2),x) without boundaries, does not work.
Arno
(05-13-2015 07:34 AM)Arno K Wrote: [ -> ]Yes, the bounded integral is no problem, the one I tried later , int(sqrt(1-x^2),x) without boundaries, does not work.
Arno

but have you already controlled the settings?
perhaps it's that...
I'm using textbook.
Otherwise, I don't know

I've the correct result also in emulator (firmware 6975)
Hi Salvo,
that are the same cas-Settings as mine, , Software Version is 6975 on the emulator as well as on my calculator, I am not able to get the symbolic integral, that is
(½)*ASIN(x)+(½)*x*√(-x^2-1).
PI/4 is no problem
(05-13-2015 08:16 AM)Arno K Wrote: [ -> ]Hi Salvo,
that are the same cas-Settings as mine, , Software Version is 6975 on the emulator as well as on my calculator, I am not able to get the symbolic integral, that is
(½)*ASIN(x)+(½)*x*√(-x^2-1).
PI/4 is no problem

mystery...
I think however it's only a settings' problem.
Let's see...
Have:
CAS settings: simplify "minimum"; Home settings Entry "textbook", complex "a+b*i", allow complex output... ok (but those shouldn't change much)...
Use helper on key C: insert ∫ and so on (without boundaries), I can see the graphic (textbook) integral, and after Enter I get the correct result.
I'm in CAS mode, the "x variable" is x and it isn't "valued" (check that it doesn't have value or use use purge(x)).
It *should* work by you Yes, you are right, I reset the Emulator, entered the integral and it worked fine. Now I reinstalled my backup, reentered the integral and got the same weird result than before. Your CAS Settings don't work either, the helper from key C doesn´t change anything. So it is up to me, to look for a solution, the Problem seems to be caused by one of the installed programs which I keep on the same level on both the emu and the calc, I now start thinking of having the emu empty for testing and then using these things on the calc
Arno
edit: after playing around with various settings I again reset the Emulator, then looked at the settings there, reinstalled the backup, set everything like in the fresh emu and it worked. The whole problem is caused by: use i, which I had checked in the cas-settings. I hadn't awaited that, this flag was, in my opinion, for the calc to be used for factorization of polynomials
(I don't see the point where here a polynomial is factored but perhaps can M. Parisse help and make things clearer)
and perhaps for output purposes of complex numbers , i.e. (3,5) versus 3+5*i, but it seems to influence other calculations as well.
It would be nice if things like that, which are rather annoying, were clearly mentioned in the manual.
(05-13-2015 08:52 AM)Arno K Wrote: [ -> ]Yes, you are right, I reset the Emulator, entered the integral and it worked fine. Now I reinstalled my backup, reentered the integral and got the same weird result than before. Your CAS Settings don't work either, the helper from key C doesn´t change anything. So it is up to me, to look for a solution, the Problem seems to be caused by one of the installed programs which I keep on the same level on both the emu and the calc, I now start thinking of having the emu empty for testing and then using these things on the calc
Arno

Have already compared the Settings (both CAS and Home) in Emulator (after reset) and the Prime?
Maybe there is one different...
I don't know if a custom program could change the result of the integral, I think this is a bit strange...

salvo
(05-13-2015 08:57 AM)salvomic Wrote: [ -> ]
(05-13-2015 08:52 AM)Arno K Wrote: [ -> ]Yes, you are right, I reset the Emulator, entered the integral and it worked fine. Now I reinstalled my backup, reentered the integral and got the same weird result than before. Your CAS Settings don't work either, the helper from key C doesn´t change anything. So it is up to me, to look for a solution, the Problem seems to be caused by one of the installed programs which I keep on the same level on both the emu and the calc, I now start thinking of having the emu empty for testing and then using these things on the calc
Arno

Have already compared the Settings (both CAS and Home) in Emulator (after reset) and the Prime?
Maybe there is one different...
I don't know if a custom program could change the result of the integral, I think this is a bit strange...