# Tag Info

1

Your results are complex. If this is OK with you, you might apply this: lst = Table[{x,NIntegrate[(0.657721 (1 - (1 - u2) x)^2.547 (1 + (1 - u2) x - u2 x)^2.547 (1 - 0.176 ((1 - u2) x)^1.2) (1 - 0.176 (-(1 - u2) x + u2 x)^1.2))/(((1 - u2) x)^0.056 (-(1 - u2) x + u2 x)^0.056`), {u2, 0, 1}]}, {x, 0.1, 1, 0.05}]; The result ...

7

FindSequenceFunction and FindGeneratingFunction can do this. They won't immediately work every time. This is what I did: First notice that if we find $f(x)$ for $k=1$ then the solution for arbitrary $k$ is just $k \,f(kx)$. Then, write the coefficients into a list ... coeffs = {0, 1/6, 0, -1/120, 0, 1/5040, 0, -1/362880, 0, 1/39916800} ... and try ...

2

There are two branch points: $$z=-\frac{1}{2}\pm i \frac{\sqrt{2}}{2}$$ we can set the branch cuts connecting these two points and set up a contour like this (sorry for the poor drawing): The two small circles in green near the two singularities have no contribution, since the function goes as $\frac{1}{\sqrt{z}}$ near the poles. And the four blue ...

6

You could integrate over the region, using Boole: Integrate[ Boole[0 < p < 1 && 0 < e1 < 1/2 && 0 < e2 < 1/2 && (p < e1 || (p) (e1)/((p) (e1) + (1 - p) (1 - e2)) < e1/e2)], {p, 0, 1}, {e1, 0, 1/2}, {e2, 0, 1/2}] (* 1/16 (5 - 6 Log[2] + 2 Log[4]) *)

2

Using @ubpdqn's answer for getting a closed expression for the dependence of the integral on the dimension n. vol[n_] := vol[n] = FullSimplify[Nest[Integrate[# /. r -> Sqrt[r^2 - x^2], {x, -r, r}] &, 2 r, n], Element[r, Reals] && r > 0] ...

0

It seems you have to set GenerateConditions explicitly Integrate[Exp[a x + b y], {x, 0, Infinity}, {y, 0, Infinity}, GenerateConditions -> True] (* ConditionalExpression[1/(a b), Re[b] < 0 && Re[a] < 0] *)

1

For a quadratic function, sometimes the extreme value (max. or min.) occurs at the vertex, at $x = -b/2a$; otherwise, it will occur at one of the endpoints of the interval. In this case $a =5 >0$, so the maximum will occur at an endpoint, the one farthest from the vertex, $x = -b/2a = -1/10$. Thus it will be the right endpoint, $x = 5$. So, in terms of ...

5

Having an exact input we can find an exact solution: Maximize[{ 5 x^2 + x + 2, -5 <= x <= 5}, x] {132, {x -> 5}} We could simply provide appropriate mathematical tools fulfilling expectations (adequate conditions on derivatives of the function, i.e. vanishing of the first derivative (a critical point) and negativity of the second derivative, ...

1

opt = {a -> 5, b -> 1, c -> 2}; y = a x^2 + b x + c FindMaxValue[{y /. opt, -5 < x < 5}, x] (* 131.999999424241 *) If you want the x value also, use opt = {a -> 5, b -> 1, c -> 2}; y = a x^2 + b x + c; r = FindMaximum[{y /. opt, -5 < x < 5}, x]; Plot[y /. opt, {x, -5, 5},Epilog->{Red, PointSize[Large], Point[{x ...

5

If you are trying to take the derivative of $\binom{n}{k}p(1-p)^{n-k}$ where "nchoosek" is $\binom{n}{k}=\frac{n!}{k!(n-k)!}$ with respect to $p$ in Mathematica, or specifically, compute $$\frac{d}{dp}\binom{n}{k}p(1-p)^{n-k},$$ then you can do this with D[n!/(k! (n - k)!)*p*(1 - p)^(n - k), p] // Simplify If you are trying to differentiate with respect ...

1

I think I can answer my question. Mathematically, it makes sense to tell Mma which variable is the one to integrate by parts, like LaplaceTransform or D. Taking this into account, I redefine parts like this parts[u_,v_,{x_,n_}]:= Sum[(-1)^m D[u,{x,m}] Nest[Integrate[#,x]&,v,m+1],{m,0,n-1}] + (-1)^n Integrate[D[u,{x,n}] ...

1

You can specify the cases for when $u$ and $v$ are free of variable. ByParts[u_, v_, t_] := With[{w = Integrate[v, t]}, u w - Integrate[D[u, t] w, t]] ByParts[u_, v_, t_] := u Integrate[v, t] /; FreeQ[u, t] ByParts[u_, v_, t_] := v Integrate[u, t] /; FreeQ[v, t]

2

Clearly It is a bug in Integrate. g = (a/(2*\[Pi]))/((x - x0)^2 + (a/2)^2); Integrate[g, {x, -Infinity, Infinity}] Now do the indefinite integration int0 = Integrate[g, x] % /. {x0 -> 10} /. {a -> 4} (% /. x -> Infinity) - (% /. x -> -Infinity) (* 1 *) I tried to do Full Trace to see if a clue might show up to tell one ...

7

If a numerical answer is good enough you can just enter the path. As @Artes said it doesn't have to be the circle exactly. NIntegrate[f[z], {z, 2 - 2 I, 2 + 2 I, -2 + 2 I, -2 - 2 I, 2 - 2 I}] (* 0. - 0.398582 I *) Check : I (-11 + 4 E) Pi // N (* 0. - 0.398582 I *) Another suggestion from @Artes (thanks !) : one can use symbolic integration as well and ...

14

For this function: f[z_] := (1 - E^z + z)/(z^3 (z - 1)^2) there are no branch cuts in the complex plane therefore we simply use Cauchy integral theorem and the related formula of the complex residue, i.e. we sum up residues of the function $f$ in the circle $\mid z \mid =2$. Let's denote $$int = \oint_{\mid z \mid =2}\frac{1-e^z+z}{z^3 (z-1)^2}dz$$ Now ...

2

I managed to teach Mathematica calculate the integral for arbitrary $n$, with a little aid: $$\int_0^L\rho(n,x)\ln(\rho(n,x))dx = (2/L)\int_{0}^{L}\sin^2(n\pi x/L)\ln\left[(2/L)\sin^2(n\pi x/L)\right]dx$$ Mathematica has trouble, apparently, handling all the parameters $(n,L,x)$, so I resort to the following substitution: $n\pi x/L=u \Rightarrow (n\pi/L) ... 2 Here's a way to approach this by defining a function for each$n\$, which you can then do separately. L = 1; u[n_, x_] := Sqrt[2/L] Sin[n π x/L]; ρ[n_, x_] := u[n, x]\[Conjugate] u[n, x]; integrand[n_, x_] := Simplify[-ρ[n, x] Log[ρ[n, x]], n ∈ Integers && x ∈ Reals] Now calculate the desired integral: Integrate[integrand[1, x], {x, 0, L}] -1 + ...

1

The following code yields the correct result: Another interesting fact is that if I omit the assumption that k ∈ Reals, then Mathematica still gets it right, but it takes ~3x more time: What is puzzling though is that if I use Assumptions with Integrate I don't get the expected result: I was under the impression that Assuming[{a1,a2,...}, ...

1

Here's as close as I can get via Mathematica. First, I just simplify the integrand once for all. Having Simplify in the definition of a function could be really slow. Edit: I added the unsimplified versions of the OP's functions, including a substitution of Boole for If, which I omitted to include in the original answer. u[n_, x_] := Boole[0 <= x ...

2

This is a stupid workaround. Anyway: FindSequenceFunction@Table[Integrate[k^2 η[n, k], {k, -∞, +∞}, Assumptions -> {n == p}], {p, 5}] (* π^2 #1^2 & *)

Top 50 recent answers are included