using math, reduce; // Initialization (this requires the REDUCE image file in the current dir). reduce::start "C:/Users/scios/Desktop/pure-lang/pure-reduce/reduce.img" {"-v"}; // Verbosity level. 0 means no noise at all. reduce::verbosity 0; // Package: DEFINT (definite integrals) // Calculating integrals by using the Meijer G integration formula. //http://www.reduce-algebra.com/docs/defint.pdf // reduce::load "defint" ; def exp x = (quote e)^x; // Some definite integrals let r1 = simplify $ intg (exp(-x)) x 0 infinity ; // -> 1 let r2 = simplify $ intg (x*sin(1/x)) x 0 infinity ; // -> uneval let r3 = simplify $ intg (x^2*cos(x)*exp(-2*x)) x 0 infinity ; // -> 4%125 //let r4 = simplify $ intg (x*exp(-1/2x)*Heaviside(1-x)) x 0 infinity ; let r4 = simplify $ intg (x*exp(-1/2*x)) x 0 1 ; // -> 2*sqrt e*(2*sqrt e-3)/e let r5 = simplify $ intg (x*log(1+x)) x 0 1 ; // -> 1%4 ; let r6 = simplify $ intg (cos(2*x)) x y (2*y); // -> (sin (4*y)-sin (2*y))/2 // Laplace transform // ================= let r7 = simplify $ laplace_transform (exp(-a*x)) x ; // -> 1/(a+s) // Hankel transform // ================ let r8 = simplify $ hankel_transform (exp(-a*x)) x ; // -> // s^(n/2)*gamma (n/2)*hypergeometric [(n+2)/2] [n+1] // ((-s)/a)*n/(2*a^(n/2)*gamma (n+1)*a) // Y transform // =========== let r9 = simplify $ y_transform (exp(-a*x)) x ; // -> // (a^n*gamma (n+1)*gamma ((-n)/2)*gamma ((-2*n-1)/2)* // gamma ((2*n+3)/2)*hypergeometric [(-n+2)/2] [-n+1] // ((-s)/a)+s^n*gamma (-n)*gamma (n/2)*hypergeometric [(n+2)/2] [n+1] // ((-s)/a)*n*pi)/(2*s^(n/2)*a^(n/2)*gamma ((-2*n-1)/2)* // gamma ((2*n+3)/2)*a*pi) // K transform // =========== let r10 = simplify $ k_transform (exp(-a*x)) x ; // -> // (-a^n*gamma (n+1)*gamma ((-n)/2)*hypergeometric [(-n+2)/2] [-n+1] // (s/a)+s^n*gamma (-n)*gamma (n/2)*hypergeometric [(n+2)/2] [n+1] // (s/a)*n)/(4*s^(n/2)*a^(n/2)*a) // StruveH transform // ================= let r11 = simplify $ struveh_transform (exp(-a*x)) x ; // -> // 2*s^((n+1)/2)*gamma ((n+3)/2)* // hypergeometric [1,(n+3)/2] [(2*n+3)/2,1.5] ((-s)/a)/ // (sqrt pi*a^((n+1)/2)*gamma ((2*n+3)/2)*a) // Fourier sine transform // ====================== let r12 = simplify $ fourier_sin (exp(-a*x)) x ; // -> s/(a^2+s^2) // Fourier cosine transform // ======================== let r13 = simplify $ fourier_cos (exp(-a*x)) x ; // -> a/(a^2+s^2)