Tag Info

Hot answers tagged

13

It's not a bug if you consider this behavior as a logical continuation of the following permissible syntax: D[a + b x^3, x, x, x] (* ==> 6 b *) D[a + b x^3, x, x] (* ==> 6 b x *) D[a + b x^3, x] (* ==> 3 b x^2 *) D[a + b x^3] (* ==> a + b x^3 *) The point is that a Sequence of variables is allowed following the first argument of D. And ...


10

One can simply use: Limit[((1 + a x)^(1/4) - (1 + b x)^(1/4))/x, x -> 0] to get the result. However Limit does know about the l'Hopital rule. Nonetheless there are different ways to go, e.g. let's use Series to write down the first few terms of the Taylor series of ((1 + a x)^(1/4) - (1 + b x)^(1/4))/x: Series[((1 + a x)^(1/4) - (1 + b x)^(1/4))/x, ...


8

The problem is that the real part of the argument in the Gamma functions is not recognized as being real. The only thing you have to do in order to circumvent this problem is to give a name to the quantity that appears as the real part and specify explicitly that it is real. Here I do this: Simplify[ Assuming[ y ∈ Reals && m ∈ Reals && q ...


5

This ordering is used in all functions in Mathematica, not just Integrate. Here's an example with Table: In[1]:= Table[f[i, j], {i, 3}, {j, 4}] Out[1]= {{f[1, 1], f[1, 2], f[1, 3], f[1, 4]}, {f[2, 1], f[2, 2], f[2, 3], f[2, 4]}, {f[3, 1], f[3, 2], f[3, 3], f[3, 4]}} The inner loop is according to j, the outer according i. In[2]:= ...


5

I Let's write down an appropriate system we would like to solve, i.e. we are to maximize a^3 + b^3 + c^3 knowing that a + b + c == 5 and 1/a + 1/b + 1/c == 1/5, thus the most direct approach uses Maximize with adequate conditions: Maximize[{a^3 + b^3 + c^3, a + b + c == 5, 1/a + 1/b + 1/c == 1/5}, {a, b, c}] {125, {a -> 1, b -> 5, c -> -1}} ...


4

First, let us notice that the limit follows from the following: Lemma. $\displaystyle \lim_{u \rightarrow 0} {(1+u)^{1/4}-1 \over u} = {1 \over 4}$. For $${{(1+a\,x)^{1/4} - (1+b\,x)^{1/4}} \over {x}} = {{(1+a\,x)^{1/4} - 1} \over {x}} - {{(1+b\,x)^{1/4} - 1} \over {x}}$$ $$ = a\,{{(1+u)^{1/4} - 1} \over {u}} - b\,{{(1+v)^{1/4} - 1} \over {v}}\,,$$ ...


3

This is at least how I might start such a problem: First define a function that calculates the numerical integral (using your definition) from 0 to some number: res[a_?NumericQ, xmax_?NumericQ] := res[a, xmax] = NIntegrate[ x Tanh[Pi x] Sqrt[x^2 + a^2] - (a^2/2 + x^2) Tanh[\[Pi] x], {x, 0, xmax}, WorkingPrecision -> 50] You might notice ...


3

The only thing wrong with your code is that Series doesn't return an expression suitable for evaluation at specific values of the expansion variable. You first have to convert the SeriesData object to a normal expression using Normal. This is the only change needed: i1[ϵ_] = Normal[Series[i[ϵ], {ϵ, 0, 1}]]; With this, the integration works as expected: ...


2

k = 1.69 (NIntegrate[Max[0, # - k] , {x, 0, 2}]/ NIntegrate[ # , {x, 0, 2}] *100 ) & @ (Sin[x] x^2) 28.3033 Incidentally this works analytically: k = Pi^2/(6 Sqrt[3]) (Integrate[Max[0, # - k] , {x, 0, 2}]/ Integrate[ # , {x, 0, 2}] *100 ) & @ (Sin[x] x^2) Which I find a bit surprising since this doesn't work: ...


2

Following @Chenminqi's method ; Manipulate[ xmin = NSolve[f[x] == threshold && 0 <= x <= 2, x][[1, 1, 2]] //Quiet; Column[{Style[ToString@NumberForm[ NIntegrate[f[x] - threshold, {x, xmin, 2}]/smax*100, {4, 1}, NumberPadding -> {" ", " "}] <> " %", Red, 18], Plot[{f[x], threshold}, {x, 0, 2}, Filling ...


1

Try this ... I changed your code a bit: eqn1 = f'[x] == -k (x - \[Mu]) f[x] eqn2 = 1/f \[DifferentialD]f == -k (x - \[Mu]) \[DifferentialD]x \[Integral]1/ f[x] \[DifferentialD]f[ x] == \[Integral]-k (x - \[Mu]) \[DifferentialD]x Exp[Log[f[x]]] == Exp[k (-(x^2/2) + x \[Mu])] (* you'll see it's the same as *) DSolve[eqn1, f[x], x] Gives for me: ...


1

f[func1_,func2_,xmin_,xmax_]:=Module[{sol}, sol=Solve[func1[x]==func2&&xmin<x<xmax,x][[All,1,2]]//Quiet; If[func1[xmin]>func2,PrependTo[sol,xmin]]; If[func1[xmax]>func2,AppendTo[sol,xmax]]; Column[{Total[#2-#1&@@@Partition[sol,2]]/(xmax-xmin), Plot[{func1[x],If[Or@@(Less[#1,x,#2]&@@@Partition[sol,2]),func2,func1[x]]}, ...



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