Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x)

 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Barton Willis - 2014-02-28 19:35:51 > Now, I just hope to simplify >- log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) >It should be equal to -2*asinh(sqrt(x)), but I can not work out it in Maxima Try something like this. In some (large) hunk of the complex plane, I think that log(w) = asinh((w^2-1)/(2*w)). Thus (%i1) algebraic : true; (%o1) true (%i2) - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)); (%o2) log(sqrt(x+1)-sqrt(x))-log(sqrt(x+1)+sqrt(x)) (%i3) subst(log = lambda([w], asinh((w^2-1)/(2*w))),%); (%o3) asinh(((sqrt(x+1)-sqrt(x))^2-1)/(2*(sqrt(x+1)-sqrt(x))))-asinh(((sqrt(x+1)+sqrt(x))^2-1)/(2*(sqrt(x+1)+sqrt(x)))) (%i4) ratsimp(%); (%o4) -2*asinh(sqrt(x)) Substituting a lambda form for a function has been called my favorite trick. It is. --Barton

 [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Jinsong Zhao - 2014-02-28 05:09:12 Hi there, I am newcomer to Maxima. I tried the following expression (%i42) integrate(sqrt(x) * sqrt(x + 1), x), radcan; I got the result: (%o42) (- log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) + sqrt(x) sqrt(x + 1) (4 x + 2))/8 It seems that - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) could be simplified to -2 * asinh(sqrt(x)) But I don't know how in Maxima. Any help? Thanks a lot. Regards, Jinsong
 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Dan - 2014-02-28 18:32:13 Jinsong Zhao yeah.net> writes: > > Hi there, > > I am newcomer to Maxima. I tried the following expression > > (%i42) integrate(sqrt(x) * sqrt(x + 1), x), radcan; > > I got the result: > > (%o42) (- log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) > + sqrt(x) sqrt(x + 1) (4 x + 2))/8 > > It seems that > - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) > could be simplified to > -2 * asinh(sqrt(x)) > > But I don't know how in Maxima. > diff(-2*sqrt(x)*sqrt(x+1),x) is : 1 - ------------------- sqrt(x) sqrt(x + 1) not -sqrt(x)*sqrt(x+1)
 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: dan - 2014-02-28 18:42:09 Dan outlook.com> writes: > diff(-2*sqrt(x)*sqrt(x+1),x) is : > > 1 > - ------------------- > sqrt(x) sqrt(x + 1) > > not > > -sqrt(x)*sqrt(x+1) > > ------------------------------------------------------------------------------ > Flow-based real-time traffic analytics software. Cisco certified tool. > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer > Customize your own dashboards, set traffic alerts and generate reports. > Network behavioral analysis & security monitoring. All-in-one tool. > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk > Sorry, Correction to my previous reply: diff(-2*asinh(sqrt(x)),x) is: 1 - ------------------- sqrt(x) sqrt(x + 1) not -sqrt(x)*sqrt(x+1) D.J
 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Jinsong Zhao - 2014-02-28 18:52:43 On 2014/2/28 10:31, Dan wrote: > Jinsong Zhao yeah.net> writes: > >> >> Hi there, >> >> I am newcomer to Maxima. I tried the following expression >> >> (%i42) integrate(sqrt(x) * sqrt(x + 1), x), radcan; >> >> I got the result: >> >> (%o42) (- log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) >> + sqrt(x) sqrt(x + 1) (4 x + 2))/8 >> >> It seems that >> - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) >> could be simplified to >> -2 * asinh(sqrt(x)) >> >> But I don't know how in Maxima. >> > > > diff(-2*sqrt(x)*sqrt(x+1),x) is : > > 1 > - ------------------- > sqrt(x) sqrt(x + 1) > > not > > -sqrt(x)*sqrt(x+1) > (%i3) -log(sqrt(x+1)+sqrt(x))+log(sqrt(x + 1)-sqrt(x)),logcontract; sqrt(x + 1) - sqrt(x) (%o3) log(---------------------) sqrt(x + 1) + sqrt(x) %o3 can be simplify to - 2 log(sqrt(x + 1) + sqrt(x)) = -2 ashin(sqrt(x)) But I don't know how to work out it in Maxima. Regards, Jinsong
 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Jinsong Zhao - 2014-02-28 19:04:10 On 2014/2/28 10:41, dan wrote: > Dan outlook.com> writes: > > diff(-2*asinh(sqrt(x)),x) is: > > 1 > - ------------------- > sqrt(x) sqrt(x + 1) > > not > > -sqrt(x)*sqrt(x+1) > > D.J > I made the problem to be complex in the original post. I should make it more clear. Now, I just hope to simplify - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) I try: (%i24) - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)); (%o24) log(sqrt(x + 1) - sqrt(x)) - log(sqrt(x + 1) + sqrt(x)) (%i25) logcontract(%); sqrt(x + 1) - sqrt(x) (%o25) log(---------------------) sqrt(x + 1) + sqrt(x) It should be equal to -2*asinh(sqrt(x)), but I can not work out it in Maxima. Regards, Jinsong
 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Barton Willis - 2014-02-28 19:35:51 > Now, I just hope to simplify >- log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)) >It should be equal to -2*asinh(sqrt(x)), but I can not work out it in Maxima Try something like this. In some (large) hunk of the complex plane, I think that log(w) = asinh((w^2-1)/(2*w)). Thus (%i1) algebraic : true; (%o1) true (%i2) - log(sqrt(x + 1) + sqrt(x)) + log(sqrt(x + 1) - sqrt(x)); (%o2) log(sqrt(x+1)-sqrt(x))-log(sqrt(x+1)+sqrt(x)) (%i3) subst(log = lambda([w], asinh((w^2-1)/(2*w))),%); (%o3) asinh(((sqrt(x+1)-sqrt(x))^2-1)/(2*(sqrt(x+1)-sqrt(x))))-asinh(((sqrt(x+1)+sqrt(x))^2-1)/(2*(sqrt(x+1)+sqrt(x)))) (%i4) ratsimp(%); (%o4) -2*asinh(sqrt(x)) Substituting a lambda form for a function has been called my favorite trick. It is. --Barton
 Re: [Maxima-discuss] how to simplify integrate(sqrt(x) * sqrt(x + 1), x) From: Barton Willis - 2014-03-01 12:40:54 >> Substituting a lambda form for a function has been called my favorite trick. It is. >Thank you very much! I will try to understand this trick. Maybe I shouldn't call it a trick--substitution of one function for another is a fairly natural operation. Often it is convenient for the substituted function to be a lambda form (anonymous function), but it doesn't have to be. If the substituted function isn't a lambda form, it might be necessary to call ev on the result: (%i36) f(x,y) := max(x,y)\$ (%i37) subst(g = f, g(2,4)); (%o37) f(2,4) (%i38) ev(%); (%o38) 4 When substituting a lambda form for a function, the lambda form is automatically evaluated. This is inconsistent--maybe soon this behavior will be changed. To substitute for +, *, ^, ^^, enclose the operator in double quotes; for example to convert from non-commutative multiplication to commutative multiplication, use (%i49) subst("." = "*",a.b.a); (%o49) a^2*b Internally, a-b is a + (-1 * b), so substitution for "-" might not work as expected: (%i54) subst("-" = f,a-b); (%o54) a-b (%i55) subst("+" = f,a-b); (%o55) f(a,-b) One thing that consistently trips me up is substitution for noun form. Substitution for integrate doesn't seem to work (%i67) subst('integrate = lambda([e,x,a,b], quad_qag(e,x,a,b,6)), integrate(x^x,x,0,1)); (%o67) integrate(x^x,x,0,1) But substitution for the noun form of integrate does (%i68) subst(nounify('integrate) = lambda([e,x,a,b], quad_qag(e,x,a,b,6)), integrate(x^x,x,0,1)); (%o68) [0.78343051069213,2.1976896391359236*10^-9,549,0] --Barton