# Tag Info

9

You are correct in that the limit of the complex logarithm on the standard branch, as $x\to 0$ from below, should better be written as $-\infty + i \pi$. The reason why Mathematica doesn't give this result is that it uses a polar representation for infinity in the complex plane. You can see this by doing FullForm[Limit[2^x Log[x], x -> 0, Direction ...

7

Since Mathematica is a really powerful symbolic computing system I recommend to proceed symbolically as far as we can. We define a function curve depending on t and four real positive parameters a, b, c, d: curve[t_, a_, b_, c_, d_] := a Exp[-((b (c - d t)^2)/t)]/Sqrt[t] Now Mathematica can evaluate this integral symbolically: integral[x0_, x_, a_, ...

6

Following this answer, if we define a couple of rules for formal differentiation. Clear[d]; d[Log[x_], a[k_]] := 1/x d[x, a[k]] d[Sum[x_, y__], a[k_]] := Sum[d[x, a[k]], y] d[a[k_] b_., a[k_]] := b /; FreeQ[b, a] d[a[q_] b_., a[k_]] := b Subscript[δ, k, q] /; FreeQ[b, a] d[c_ b_, a[k_]] := d[c, a[k]] b + d[b, a[k]] c d[b_ + c_, a[k_]] := d[c, a[k]] + d[b, ...

6

The problem can be completely solved symbolically using the standard methods. Here we go. The function in question is given by f[x_] := Cos[x] Cos[2 x] + I Sin[x] Sin[2 x] The square of the absolute value for real x is then fa[x_] = ComplexExpand[f[x]*Conjugate[f[x]]] // Simplify (* Out[94]= Cos[x]^2 (2 - 2 Cos[2 x] + Cos[4 x]) *) The extrema of ...

5

I sometimes have a similar problem and a rather "rough" workaround. First make a plot of the function - omitting the output: p = Plot[Norm@f[x], {x, 0, 2 \[Pi]}]; then extract the line segments data = Cases[p, Line[{x__}] :> x, \[Infinity]]; then find the peaks max = FindPeaks[#[[2]] & /@ data] finally plot the result(s): Show[p, Epilog ...

5

As far as I see, the problem is (as you already wrote), that MeanResidualLife takes a long time to compute, even for a single evaluation. Now, the FindMinimum or similar functions try to find a minimum to the function. Finding a minimum requires either to set the first derivative of the function zero and solve for a solution. Since your function is quite ...

5

The source of your problem is using Integrate with i[t, freq] in the expression. It doesn't integrate. Using NIntegrate (as suggested by Michael E2) the problem can be solved in a reasonable amount of time. Below are two changes. ReI[freq_] := 2/tmax[freq]*NIntegrate[ReaF[t, freq], {t, 0, tmax[freq]}] ImI[freq_] := 2/tmax[freq]*NIntegrate[ImaF[t, ...

4

You can increase the performance of i considerably simply by making sure that IBV is evaluated only once. i0 = 0.0001; alpha = 0.5; E0 = 0; T = 293; z = 1; Cdl = 0.000001; iLimit = 0.0005; U0 = 0.1; bvVor = z*96485/8.314/T; U[t_, freq_] := U0*Sin[2*π*freq*t] DU[t_, freq_] := 2*freq*π*U0*Cos[2*freq*π*t] iBV[t_, freq_] := i0*(-Exp[(alpha - ...

4

I'm not used to your notation, but does this give you what you mean? Block[{a1, a2, b1, b2}, SetAttributes[{a1, a2, b1, b2}, Constant]; Dt[t]/Dt[f1] /. First@Solve[ {Dt[f1] == Dt[F1[t, g]], 0 == Dt[F2[t, g]]}, {Dt[f1], Dt[t]}] // Simplify ] (* b2/(-a2 b1 + a1 b2) *)

4

You can get an expression that is I-free by evaluating Integrate[ (1 + a*Abs[ze - zh])*E^(I*b*ze - a*Abs[ze - zh])*Cos[Pi*ze]^2*Cos[Pi*zh]^2, {ze, -1/2, 1/2}, {zh, -1/2, 1/2}, Assumptions -> Element[{a, b}, Reals]] // ComplexExpand // FullSimplify (8 E^-a π^4 (a b (b^4 - 20 b^2 π^2 + 64 π^4) (a^11 - 7 a^10 (-1 + E^a) + 16 a^9 π^2 - ...

4

For a fixed numerical value of x the sum limit can be found using Shanks transformation or Richardson extrapolation. The Richardson extrapolation transformation of the sequence gives faster convergence. The results seem to be in agreement with the plots in the answer by Willinski -- see the attached image. Here is the code for Shanks: Clear[Shanks] ...

4

It looks like your integral results vary by a constant of integration (see Possible Issues->Indefinite Integrals in the documentation for Integrate). Observe FFex1[x_, X_, Y_, Z_, t_] := Integrate[((x - X) (t/Sqrt[ t^2 + x^2 - 2 x X + X^2 + y^2 - 2 y Y + Y^2 + 2 t Z + Z^2] + Z (-(1/Sqrt[x^2 - 2 x X + X^2 + y^2 - 2 y Y + Y^2 + ...

3

Mathematica gives generic answers, and you will need to handle the singularity at m=-1 as a separate case. Even simpler than your example is: Integrate[x^m, x] x^(1 + m)/(1 + m) If you then evaluate at m=-1 you also get infinity Integrate[x^m, x]//.m->-1 Note that the generic answer holds for all m not equal to -1. The answer is correct for $m \neq ... 3 It's a correct result.It is best to illustrate on the plot. f[x_] := 2^x*Log[x]; {Limit[f[x], x -> 0, Direction -> 1], Limit[f[x], x -> 0, Direction -> -1]}$\{-\infty ,-\infty \}$Plot[{Re@f[x], f[x]}, {x, -2, 2}, Filling -> Bottom, PlotRange -> {{-2, 2}, {-10, 3}}, PlotLegends -> "Expressions"] 3 The Residue can be zero at a pole (look here). For example$1/z^2$has a residue 0 at z=0. If you make a Laurent Series there will no term with 1/z. (It depends on the analyticity of the function at the pole). For your function you can verify it easily by following b.gatessucks 's suggestion. f = NPI11[z]/D1; Normal[Series[NPI11[z]/D1, {z, #, 1}]] & /@ ... 3 The specific combination to use based on my comment is FullSimplify[ExpToTrig[Integrate[(1 + a*Abs[ze - zh])*E^(I*b*ze - a*Abs[ze - zh])* Cos[Pi*ze]^2*Cos[Pi*zh]^2, {ze, -2^(-1), 1/2}, {zh, (-1*1)/2, 1/2}, Assumptions -> Element[{a, b}, Reals]]]] This will get you the real-valued result (4 E^-a \[Pi]^4 (2 a b (b^4 - 20 b^2 \[Pi]^2 + 64 \[Pi]^4) ... 3 The way you have translated the physics problem into Mathematica is the source of the problem. Solve[D[m*D[y[t], t], t] == 0, D[y[t], t]] If your remove D[y[t] from the above expression then Solve will yield a solution. solution = Solve[D[m*D[y[t], t], t] == 0, t] {{t -> (I π)/Sqrt[(b^2 - 4 g m^2)/m^2] + (1/Sqrt[(( b^2 - 4 g m^2)/( ... 3 A first-year calculus approach to finding Taylor series: order = 10; (* derivative order *) step[x0_][{eqn_, coeffs_}] := {#, {coeffs, Solve[# /. x -> x0 /. Flatten@coeffs]}} &[D[eqn, x]]; derivatives = Flatten@ Last@ Nest[step[x0], {f[x, y[x]] == 0, y[x0] -> y0}, order]; y1 = Normal@Series[y[x], {x, x0, Length@derivatives - 1}] /. ... 3 Write y as an explicit function of x. Then one can solve for successive derivatives to set up a Taylor approximation. Below is some slightly messy code for this. taylor[func_, x_, y_, pt_, n_] := Module[ {f = func[x, y] /. y -> y[x], deriv, var = y[x], sol, newsol}, deriv = f; sol = {y[x] -> pt[[2]]}; pt[[2]] + Sum[ deriv = D[deriv, x]; ... 3 Try this: g[y_] := Inactivate[Integrate][f[x, y], {x, a[y], b[y]}]; Then its derivative: D[g[y], y] yields Let us now make an equation: eq = Inactivate[D[Integrate[f[x, y], {x, a[y], b[y]}], y], D | Integrate] == D[g[y], y] and solve it with respect to the integral in question: Done. Have fun! 3 Replace the last line with temp = D[Bfieldbyradius /. a, R] Plot[(-R/Bfieldbyradius) * temp, {R, 0, 1/6}] I don't know exactly why your code doesn't work but it is related to the use of a wrong argument for Derivative[1][...] and evaluating within Plot (as opposed to doing it outside first) the derivative of a function whose variable being differentiated ... 3 It is always a good strategy to consider the options, see in this case, E Exp Sometimes a plot of known sizes is helpful and inspiring Plot[{E, Exp[-1/x^2]}, {x, -3, 3}, PlotTheme -> "Detailed"] So, der1 = D[Exp[-1/x^2], x] leads to$\frac{2 e^{-\frac{1}{x^2}}}{x^3}$and we can plot the result Plot[{Exp[-1/x^2], der1}, {x, -3, 3}] 2 Here I'll use a Chebyshev series instead of a Taylor series (see About multi-root search in Mathematica for transcendental equations). First we approximate the curve of interest. The interpolation will be used to seed FindRoot below to get more precise values of y for a given x. yIF = NDSolveValue[{f[x, y[x]] == 0, u'[x] == 1, u[x0] == x0, y[x0] == ... 2 The function is easier to work with, if singularities are eliminated. f[x_, y_] == (Csc[0.482 y] Sin[0.963 x - 0.482 y] + 3.247 Csc[0.333 y] Sin[0.667 x - 0.333 y] + 5.049 Csc[0.119 y] Sin[0.238 x - 0.119 y]) Sin[0.482 y] Sin[0.333 y] Sin[0.119 y] // Simplify Next, ContourPlot quickly finds all the zero-curves. plt = ... 2 You can take the indefinite integral. Then you could try to use the fundamental theorem of calculus which means inserting the two boundary values for x into the indefinite integral and taking the difference. The result is the integral to be calculated in the OP if the indefinite intergral is a continuous function of x in the interval between 0 and 2 Pi. But ... 2 It's a correct result. The computation below may help to see this. Table[2^x Log[x], {x, -(10.^Range[-1, -10, -1])}] (* Out[48]= {-2.14838785758 + 2.93120959177 I, -4.57335995192 + 3.119892088 I, -6.90296884693 + 3.13941582202 I, -9.20970198196 + 3.14137490253 I, -11.5128456637 + 3.1415708778 I, -13.8155009818 + 3.141590476 I, -16.1180945337 + ... 2 See EDIT #3 for a valid answer. First answer This is not an answer to my question but just a mathematical derivation of the limit the existence of which was even doubted in some comments and answers. I hope this does not spoil the creativity. The task for Mathematica is still open. I came to the question considering something very elementary in calculus: ... 2 Install the Rule-based_Integrator of http://www.apmaths.uwo.ca/~arich/ for Mathematica. You will get a simpler structured Integral for your typical terms: In[64]:= intR2 = Int[u/((xs + xs^2 + v) Sqrt[xs + xs^2 + w]), xs] Out[64]= -(( 2 u ArcTan[(Sqrt[v - w] (1 + 2 xs))/( Sqrt[1 - 4 v] Sqrt[w + xs + xs^2])])/(Sqrt[1 - 4 v] Sqrt[v - w])) 2 It's not the solution you are looking for and surely you have tried the same. rs[x_, n_] := x/n Sum[n^2/(i + (n - i) x)^2, {i, 1, n}] rs[1., \[Infinity]] Infinity::indet: Indeterminate expression 0 [Infinity] encountered. Sum::div: Sum does not converge. Plot[rs[2., n], {n, 1, 100000}, PlotPoints -> 100] Addition << ... 2 With Limit[] seems to work. Limit[Integrate[1/(t + 1 + \[Epsilon])* DiracDelta[t + 1], {t, -\[Infinity], \[Infinity]}], \[Epsilon] -> 0]$\infty$Limit[Integrate[1/(t + 1 - \[Epsilon])* DiracDelta[t + 1], {t, -\[Infinity], \[Infinity]}], \[Epsilon] -> 0]$-\infty$we have at the same point:$(\infty\ \text{and} -\infty) \to ...

Only top voted, non community-wiki answers of a minimum length are eligible