0
$\begingroup$

I have the following integral that I want to calculate in Mathematica:

$$\int_x^y t^z \ln t \, \mathrm{d}t,$$

where $z$ is an integer and $0<x<y$.

What code can calculate this integral?

$\endgroup$
3
  • $\begingroup$ Have a look at Integrate. $\endgroup$ Commented May 24, 2023 at 10:09
  • $\begingroup$ Yes I already looked there but cannot find how to include 0<𝑥<𝑦 $\endgroup$
    – Kei Len
    Commented May 24, 2023 at 10:54
  • $\begingroup$ Integrate has an option Assumptions which you can use to specify that. $\endgroup$
    – Domen
    Commented May 24, 2023 at 11:04

1 Answer 1

0
$\begingroup$

Both gives you same answer

You can set up Global Assumption like this

$Assumptions = {{0 < x < y}, {Element[z, Integers]}}
f[z_] = t^z; 
g[t_] = Log[t]; 
Integrate[f[z]*g[t], {t, x, y}]

Also, you can use it inside Integrate like this

f[z_] = t^z; 
g[t_] = Log[t]; 
Integrate[f[z]*g[t], {t, x, y}, 
Assumptions -> {{0 < x < y}, {Element[z, Integers]}}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.