# Tag Info

3

You can do the whole thing analytically: (*ϵ=78.36; λ=0.548881;*) Clear[ϵ, λ]; funcin = 1/(ϵ * π) * Exp[-(2*r + λ * Sqrt[r^2 + ρ^2 - 2*r*ρ * Cos[θ]])] * r^2 * Sin[θ] * 1 / Sqrt[ρ^2 + r^2 - 2*r*ρ * Cos[θ]]; intfuncinang = Assuming[r > 0 && ρ > 0 && ϵ > 0 && λ > 0, Integrate[funcin, {θ, 0, π}, {ϕ, 0, 2 π}] ] (* ...

1

You can do the integrals over the angular variables analytically; the result will be a function of r, ρ : intth = 2 Pi Integrate[funcin, θ]; integ[ρ_] = (intth /. θ -> Pi) - (intth /. θ -> 0) ; output = Table[{ρ, NIntegrate[integ[ρ], {r, 0, Infinity}]}, {ρ, 0.1, 3,0.05}] ; ListLinePlot[output]

1

After some trial I managed to speed your integration up. The main idea for the optimization is to simplify the symbolic expression as much as possible before throw it in to Integrate. Also, your code can be conciser for many parts of it, I'll mention a few of them in the following part. This is the expression waiting for simplification: exp = ψy[y, Y[i]] ...

3

You can use Cauchy's theorem. Define the approximate zero of your function : zero = FindRoot[DirichletL[19, 10, s], {s, 0.5 + I}][[1, 2]] (* 0.5 + 1.51608 I *) Series will not consider this a pole of 1/DirichletL[19, 10, s] and I think this is why you get a zero residue. However, integrating on a small square around that pole one finds : Table[{eps, ...

0

Just some points: $a$ is a function of $x$ and $t$. Hence $f$ as defined will be a function of $x$.,ie. $f(x)=\int_0^\infty g(x,t)\, dt$ where $g(x,t)$ is your integrand. To numerically integrate (as question title asks &given function of Gaussian's[diffusion eqn soln]), $f(x)$ needs a numerical argument. I am not sure what your ultimate aim is. ...

0

Does this help, first you replace your equation as, Simplify[(k1*a[t])/(a[t] + k2) dt /. a[t] -> (Q/(4*Pi*N*t)^(3/2))*exp (-x^2/(4*N*t))] (dt exp k1 Q x^2)/(-32 k2 [Pi]^(3/2) (N t)^(5/2) + exp Q x^2) Now apply integral, Integrate[ Simplify[-((dt exp k1 Q x^2)/(32 N \[Pi]^(3/2) t (N t)^( 3/2) (k2 - (exp Q x^2)/(32 N \[Pi]^(3/2) t (N ...

0

I tried a few random values for constants and it worked for me. Here are some things you might be doing wrong: Using N as a variable: N is a protected symbol. Use n Using Integrate instead of NIntegrate when you want a numerical answer Defining the integral as a function: You are using $t$ as the integration variable, not as a function parameter.

4

"What solutions might I have to fix that?" As Szabolcs says, if theIntegratecommand does not return an expression, other thanIntegrate[...], thenLimithas no chance to operate. So, I would first find the integral by supplyingIntegratewith sufficient assumptions: Integrate[Sin[t^n], {t,0,Pi/2}, Assumptions :> {n>=1}] The assumption of integer $n$ is ...

0

Following Artes' Rationalizeation, why don't you simply find where the first derivative goes to zero? f[x_] := 1/Gamma[x]^14 1/(1618/(70 x))^( 14 x) 12257800000000000000^(x - 1) Exp[-14 x] Plot[f'[x], {x, 100, 1100}] FindRoot[f'[x] == 0, {x, 500}] {x -> 514.198}

7

I don't like using approximate numbers when we can use exact ones, therefore with Rationalize and RootApproximant I can rewrite the function this way: f[x_] := 1/Gamma[x]^14 1/(1618/(70 x))^(14 x) 12257800000000000000^(x - 1) Exp[-14 x] let's plot this function: Plot[ f[x], {x, 0, 1500}, PlotStyle -> Thick] We can use: NMaximize[{ f[x], 10^5 > ...

1

I ended up solving this using the algorithm below. This was rather complicated (which is why I'm only describing the process, and have omitted both the actual code and several small details), so maybe there's a better way. 1) Randomly pick the critical points, with the restriction that their slopes have to have absolute value between 1 and 3, and that ...

0

I am not sure if the solution I proposed is over-complicated. Nevertheless, I have been unsatisfied about the power of TransformationFunctions. It appears to me that give a condition (as assumptions) in Simplify is better than a transformation function. For example, Simplify[x + y, x + y == z] z However, the conditions as assumptions does not ...

1

You can also try unprotecting and changing D. For example: D[var_[is___], var_[js___]] := Times @@ MapThread[KroneckerDelta, {{is}, {js}}] Allows D[x[i, a], x[j, b]] (* KroneckerDelta[a, b] KroneckerDelta[i, j] *) This is by no means a complete solution, since it doesn't implement the product rule, for example: D[x[i, a] x[j, b], x[k, c]] (* 0 *) ...

2

I have isolated a simplified instance of the bug: a = Exp[-(ux - uy) (vx - vy)] ((ux - uy) (vx - vy))^2; i1 = Integrate[a, {vy, 0, vx}]; Assuming[ux > 0, i2a = Integrate[i1, {vx, 0, 1}, {uy, 0, ux}]; i2b = Integrate[Integrate[i1, {uy, 0, ux}], {vx, 0, 1}]; i2b - i2a // FullSimplify ] which gives 4 I \[Pi] (incorrect) rather than 0 (correct). We ...

0

It works fine on my MMA(Version 9). x[t_] := a0 + a1*t + a2*t^2 + a3*t^3 + a4*t^4 + a5*t^5; a0 = x0; a1 = v0; a2 = acc0/2; a3 = -((20 x0 - 20 xf + 12 v0 tf + 8 vf tf + 3 acc0 tf^2 - accf tf^2)/(2 tf^3)); a4 = -((-30 x0 + 30 xf - 16 v0 tf - 14 vf tf - 3 acc0 tf^2 + 2 accf tf^2)/(2 tf^4)); a5 = -((12 x0 - 12 xf + 6 v0 tf + 6 vf tf + acc0 tf^2 - accf tf^2)/(2 ...

2

It's a bug, of course. Mathematica gets dizzy by the "hanging" integration order (I believe). As simple as it is, it was tough to find out but it gives the right result if you just change the order of limits: $Assumptions = {ρ > 0, L > 0}; limits = Sequence[{ux, 0, L}, {uy, 0, ux}, {vx, 0, L}, {vy, 0, vx}]; (* instead of limits = Sequence[{ux, 0, ... 0 From your comment I'm trying to evaluate: Integrate[ D[u[x, y], x] + D[u[x, y], y], {x,x0,x1},{y,y0,y1}] and if I understand correctly, this is kind of a negative answer. If you plug this into Mathematica (v 9.0.1) Integrate[D[u[x, y], x] + D[u[x, y], y], x, y] you get this $$\int u(x,y) \, dx+\int u(x,y) \, dy$$ which shows you that there are ... 0 Using the suggestions found here, I was able to use Assuming[If[Element[z,Reals],(z<-b||z>b)]&&b>0,Integrate[f[x,z],{x,-b,b}]] 2 Problem looks to occur when doing the definite integral. If you start with the indefinite integral: int = Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), x] (* x^a/a + (x^(1 + a) Hypergeometric2F1[1, 1 + a, 2 + a, x])/(1 + a) - (c x^b Hypergeometric2F1[1, b/c, 1 + b/c, x^c])/b *) and you do the limits by hand you get: ... 2 Your syntax is correct and v.9 produces a result. If appropriate you can halp things by adding assumptions..for example: Integrate[x^(a - 1)/(1 - x) - c x^(b - 1)/(1 - x^c), {x, 0, 1}, Assumptions -> {a > 0, b > 0, c > 0}] -PolyGamma[0, a] + PolyGamma[0, b/c] Indeed.. it apperars to be incorrect.. example = {a -> ... 3 I think this can be hacked more or less case by case with UpValues, I think this is one of the most flexible aspects of Mathematica. For instance if you just want partial derivatives to interact with sums you can just define your sum function MySum (or you can maybe unprotect Sum, not sure if this is possible) and define UpValues MySum /: D[MySum[s_, i_], ... 8 If you look in the help file for Integrate under the section on "Possible Issues", there is an explanation. The docs comment: "Parameters like n are assumed to be generic inside indefinite integrals:" and the example is given of Integrate[x^n, x] which returns x^(1 + n)/(1 + n). As with the OPs integral, the answer is true for generic n, but not for a ... 10 The answer is no because of fundamental mathematical limitations which origin in the set theory regarding countability (see e.g. Cantor's theorem) - functions over a given set are more numerous than its (power) cardinality. Neither Mathematica nor any other system can integrate every function in even much more restricted class, namely Riemann integrable ... 0 So with the following code: n = 1/2 {(1 - \[Zeta]) (1 - \[Xi] - \[Eta]), \[Xi] (1 - \[Zeta]), \ \[Eta] (1 - \[Zeta]), (1 + \[Zeta]) (1 - \[Xi] - \[Eta]), \[Xi] (1 + \ \[Zeta]), \[Eta] (1 + \[Zeta])}; xe = {x1, x2, x3, x4, x5, x6}; ye = {y1, y2, y3, y4, y5, y6}; ze = {z1, z2, z3, z4, z5, z6}; x = n.xe; y = n.ye; z = n.ze; J = D[{x, y, z}, {{\[Xi], \[Eta], ... 4 This code should give you some insight as to why you are seeing this behavior: Manipulate[Plot[(a - Sqrt[a^2 + x])/(a^2 - a*Sqrt[a^2 - x]), {x, -1, 1}], {a, -3, 3}] When Assumptions -> {a > 0} is used, you get the correct limit. But when no assumptions are placed, Mathematica tries to evaluate the limit for a general complex$a$. This second ... 3 Some integrals cannot be found in terms of a finite set of functions. I'm not an expert on what the limits of Mathematica are, but the following suggests to me that this integral is beyond them. The reason comes down, by a sequence of substitutions, to the fact that this integral returns unaltered: -Integrate[Erf[Sqrt[1 - w^2]], w] (* ... 1 What you have proposed works in principal: inner[y_ /; NumericQ[y]] := ( lastx = NMinimize[-7 - 6 x + x^2 - 8 y - y^2, x]; First@lastx ) NMaximize[inner[y] , y ] lastx {-1.77636*10^-15, {y -> -4.}} {-1.77636*10^-15, {x -> 3.}}} When you see how slow this is ( a whole minute) with my simple example I think ... 3 foo[arg_] := arg /. {Gamma[p_] Gamma[q_] :> Gamma[p + q] Beta[p, q]} FullSimplify[1./(Gamma[1 + c] ((e Gamma[1 + b])/Gamma[2 + b + c] + (1. d Gamma[1.5 + b])/ Gamma[2.5 + b + c] + (f Gamma[2 + b])/Gamma[3 + b + c])), TransformationFunctions -> {Automatic, foo}] 1./(e Beta[1 + b, 1 + c] + 1. d Beta[1.5 + b, 1 + c] + f Beta[2 + b, 1 + c]) 1 -Log[-x] is not a correct result, but Log[-x] is. In fact the expressions Log[-x] and Log[x] differ only in a constant I Pi, so both are correct antiderivatives for all$x \in \mathbb{C}\$. While the result given by Mathematica is correct, it is complex valued for x < 0. I think you are looking for a real valued result. I do not think it is possible to ...

Top 50 recent answers are included