## #2428 No result for definite integral (III)

open
nobody
5
2012-11-18
2012-06-23
No

Enter:

integrate((cos(a*x)-cos(b*x))/x,x,0,inf);

and Maxima returns:

integrate((cos(a*x)-cos(b*x))/x,x,0,inf)

The correct result ist: log(b/a)

build_info("5.27.0","2012-04-24 08:52:03","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8")

Regards

Chris

## Discussion

• Aleksas - 2012-06-25

The method is based on Parsevals's identity for Laplace transform,
see for example:
S. Herman, J. Maceli, M. Rogala & O. YÜrekli
Parseval-type relations for Laplace transform and their applications
International Journal of Mathematical Education in Science and Technology
Volume 39, Issue 1, 2008
http://www.tandfonline.com/doi/abs/10.1080/00207390701368710
I do not have a copy of this article.

Example 1. integrate((cos(a*x)-cos(b*x))/x,x,0,inf)
(%i1) f(x):=cos(a*x)-cos(b*x)\$ g(x):=1/x\$
(%i3) assume(a>0,b>0)\$
(%i4) integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
(%o4) integrate((cos(a*x)-cos(b*x))/x,x,0,inf)=((b^2-a^2)*(log(a)-log(b)))/(a^2-b^2)
(%i5) lhs(%)=logcontract(rhs(%));
(%o5) integrate((cos(a*x)-cos(b*x))/x,x,0,inf)=log(b/a)

Example 2. integrate((log(x)*sin(x))/x,x,0,inf)
(%i6) f(x):=sin(x)*log(x)\$ g(x):=1/x\$
(%i8) integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
(%o8) integrate((log(x)*sin(x))/x,x,0,inf)=(%i*log(%i)^2-%i*log(-%i)^2)/4-(%gamma*%pi)/2
(%i9) lhs(%)=rectform(rhs(%));
(%o9) integrate((log(x)*sin(x))/x,x,0,inf)=-(%gamma*%pi)/2

Example 3. integrate((x-sin(x))/x^3,x,0,inf)
(%i10) f(x):=x-sin(x)\$ g(x):=1/x^3\$
(%i12) 'integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
(%o12) integrate((x-sin(x))/x^3,x,0,inf)=%pi/4

Example 4. integrate((sin(x)*cos(a*x))/x,x,0,inf)
(%i13) f(x):=sin(x)*cos(a*x); g(x):=1/x;
(%o13) f(x):=sin(x)*cos(a*x)
(%o14) g(x):=1/x
(%i15) 'integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
"Is "a-1" positive, negative, or zero?"p;
(%o15) integrate((sin(x)*cos(a*x))/x,x,0,inf)=0
(%i16) 'integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
"Is "a-1" positive, negative, or zero?"n;
(%o16) integrate((sin(x)*cos(a*x))/x,x,0,inf)=(32*%pi*a^5-64*%pi*a^3+32*%pi*a)/(4*(-2*a-2)*(2-2*a)*a*(2*a-2)*(2*a+2))
(%i17) factor(%);
(%o17) integrate((sin(x)*cos(a*x))/x,x,0,inf)=%pi/2
a=1
(%i18) 'integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
"Is "a-1" positive, negative, or zero?"zero;
plog(0) is undefined.
-- an error. To debug this try: debugmode(true);
(%i19) f(x):=sin(x)*cos(x);
(%o19) f(x):=sin(x)*cos(x)
(%i20) 'integrate(f(x)*g(x),x,0,inf)=integrate(laplace(f(x),x,s)*ilt(g(x),x,s),s,0,inf);
(%o20) integrate((cos(x)*sin(x))/x,x,0,inf)=%pi/4
Solution: if |a|<1 then %pi/2
if |a|>1 then 0
if |a|=1 then %pi/4

We have this to implement to the Maxima

Best
Aleksas Domarkas

• christoph reineke - 2012-06-25

Thanks for your help!
Parseval‘s identity…That was more than 30 years ago. ;-)
However, it seems that you found the simplest way to calculate these integrals.

By the way, here I found an example (p.179) where this identity is used.

Since you often use Laplace transforms, enter in Maxima:

laplace((log(t))^2, t, s);

MATHEMATICA knows the solution…

<We have this to implement to the Maxima>
I think then you have to put in a change request!

All the best

Chris

• Aleksas - 2012-06-26

Problem: compute Laplace transform laplace(log(x)^2,x,s)

Maxima return noun form:
(%i1) laplace(log(x)^2,x,s);
(%o1) laplace(log(x)^2,x,s)

Solving step-by-step:
(%i2) declare(integrate,linear)\$
(%i3) assume(s>0)\$
(%i4) S:'integrate(log(x)^2*exp(-x*s),x,0,inf);
(%o4) integrate(%e^(-s*x)*log(x)^2,x,0,inf)
(%i5) changevar(S, y=s*x, y, x);
(%o5) integrate(%e^(-y)*(log(y)^2-2*log(s)*log(y)+log(s)^2),y,0,inf)/s
(%i6) expand(%);
(%o6) integrate(%e^(-y)*log(y)^2,y,0,inf)/s-(2*log(s)*integrate(%e^(-y)*log(y),y,0,inf))/s+(log(s)^2*integrate(%e^(-y),y,0,inf))/s