Tag Info

Hot answers tagged

23

The standard built-in logarithm function is defined for complex variables as follows: Log[z] = Log[Abs[z]] + I Arg[z] The location of the branch cut is simply caused by the convention that polar angles of z are assumed to be in the range $-\pi$ to $\pi$. This same branch cut is also part of the definition of the built-in Arg function. Here is a different ...


21

It's true that the multivariable version of Series can't be used for your purpose, but it's still pretty straightforward to get the desired order by introducing a dummy variable t as follows: Normal[Series[f[(x - x0) t + x0, (y - y0) t + y0], {t, 0, 2}]] /. t -> 1 $(x-\text{x0}) (y-\text{y0}) f^{(1,1)}(\text{x0},\text{y0})+\frac{1}{2} ...


19

@whuber gave me another idea : first change the summand to an exponential and then do the sums using the symmetry. Integrate[Exp[-t i j k (i + j + k + 1)], {t, 0, Infinity}, Assumptions -> {i > 0, j > 0, k > 0}] (* 1/(i j k (1 + i + j + k)) *) so we need to do the sums of the exponential and then integrate at the end. Now we can make a change ...


17

In this case you can use SeriesCoefficient SeriesCoefficient[Exp[x], {x, 0, n}]


16

You want first to fix any typographical errors (such as the unbalanced parentheses) and it's also wise to avoid symbol names beginning with capital letters. Then, to obtain a series expansion in powers of $1/z$, expand the expression around infinity, not zero: Series[a + b (1 - Exp[-t/(b c)]/(z - Exp[-t/(b c)])) , {z, Infinity, 5}] $(a+b)-\frac{b ...


16

(Edited; original at the end) Gram-Schmidt orthogonalization provides an answer. Let's use a running example to illustrate. It begins even before the Chebyshev polynomials, with their domain--the interval $[-1,1]$--and the kernel for which they are orthogonal: limits = {-1, 1}; k[x_] := 2/Sqrt[1 - x^2]/Pi; The Chebyshev polynomials are obtained by ...


16

If you're new to Mathematica, then it might make sense to explore these kinds of basic things via the natural language interface. Assuming that you're connected to the internet, so Mathematica can access WolframAlpha's servers, just type = power series sinx Note that the equals sign will be reformatted to look like it's part of the WolframAlpha input ...


12

Is InverseSeries what you are looking for? InverseSeries[Series[ArcTan[Log[1 + x]/(1 + x)], {x, 0, 5}]] (* x+(3 x^2)/2+3 x^3+(149 x^4)/24+(68 x^5)/5+O[x]^6 *) EDIT: looks reasonable: Plot[{ pl[x], invs }, {x, -.3, .3}, PlotStyle -> {{Dashed, Black}, Red} ] Who knows what the radius of convergence is, though.


11

Here's an attempt: multiTaylor[f_, {vars_?VectorQ, pt_?VectorQ, n_Integer?NonNegative}] := Sum[Nest[(vars - pt).# &, (D[f, {vars, k}] /. Thread[vars -> pt]), k]/k!, {k, 0, n}, Method -> "Procedural"] multiTaylor[f[x, y], {{x, y}, {0, 0}, 2}] f[0, 0] + y*Derivative[0, 1][f][0, 0] + x*Derivative[1, ...


11

Try this Normal@Series[expr/.{f->x f, g->x^2 g, h->x^3 h},{x,0,4}] /.x->1


11

Partial sums of this sequence are given by: Sum[(-1)^(n + 1) Cos[3^n x]^3/3^n, {n, 1, m}] (* output: 1/4 Cos[3 x] - 1/4 (-(1/3))^m Cos[3^(1 + m) x] *) For real $x$, we know this converges because $\cos(3^{1+m}x)$ is bounded. Mathematica does not assume $x$ is real and, as Bob Hanlon notes, will produce the correct result by evaluating a partial sum, ...


10

Had InverseSeries[] not been a built-in function, one option might be to invert the Carleman matrix corresponding to the function: CarlemanMatrix[f_, {x_, x0_, {m_Integer, n_Integer}}] := Prepend[Table[ If[k == 0, Function[x, f][x0]^j, BellY[Table[{FactorialPower[j, i] Which[#2 == 0, 1, #1 == 0, 0, True, #1^#2] &[Function[x, f][x0], j - ...


10

After you define your function execute this line: Series[f, {x, \[Infinity], 1}] // Normal // PowerExpand Following your $x \gg a$ we can rewrite it as % /. (-a + x) -> x // FullSimplify which gives: Now you have to be very careful dealing with derivative. It is not enough to keep 0th and 1st terms (as you did) - you will loose information. ...


10

Here is another variant along the same lines as @whuber proposed. Consider function $$ f(x,y,z,t)=\sum _{i=1}^{\infty } \sum _{j=1}^{\infty } \sum _{k=1}^{\infty } x^{i-1} y^{j-1} z^{k-1} t^{i+j+k}. $$ Mma gives f[x_, y_, z_, t_] = Sum[x^(i - 1) y^(j - 1) z^(k - 1) t^(i + j + k), {i, 1, \[Infinity]}, {j, 1, \[Infinity]}, {k, 1, \[Infinity]}] $$ ...


10

This method of developing a truncated solution can be done as below. I illustrate with an example that DSolve does not seem much to like. ode = x''[t] - t*x'[t] + Sin[t] == 0; initconds = {x'[0] == 1, x[0] == 0}; We create a differentail operator to create this ode. odeOperator = D[#, {t, 2}] - t*D[#, t] + Sin[t] &; Now set up our Taylor series as ...


10

Let's look at the InputForm of your expression: expr = 3.4235 + (4.22 - 5.2342 I) a + 7.543 a^6 + O[a]^7; InputForm[expr] SeriesData[a, 0, {3.4235, 4.22 - 5.2342*I, 0, 0, 0, 0, 7.543}, 0, 7, 1] You want to set all the coefficients to one, so let's do that with Unitize: MapAt[Unitize, expr, 3] 1 + a + a^6 + O[a]^7 Or, if you prefer, as a Rule: ...


10

Series Expansion Answering the question we show how to construct the series expansion of f[x] about x=0. From the basic equation we find f'[x]==2(Log[a x + b]-Log[Cosh[f[x]]]) the derivative of f[x] in terms of the function f[x] itself and some other terms. Hence in the Taylor expansion of the function f[x] = f[0] + x f'[0] + x^2/2! f''[0] + x^3/3! ...


10

The fastest way to do this is to note that for any function $f$ with a convergent power series, the quasi-hyperbolic function $$g(x)=\frac{f(ix)-f(-ix)}{2i}$$ has the power series of $f$ with only odd, alternating sign terms (provided that it converges). Here's an example: f[x_] := x + x^2 + x^3 - x^4; (f[I x] - f[-I x])/(2 I) // Simplify which produces ...


10

Chances are it will behave similarly to Integrate[Exp[-x t^3 ], {t, 0, π/2}]. I show a numerical verification below. We'll use the dominant series term, which we can compute, for the above integral, and compare to numerical integrations of the one we cannot compute analytically. ee1[x_] := Exp[-x*t^3] ee2[x_] := Exp[-x*t^3*Cos[t]]; Let's get the candidate ...


9

Be explicit and do it in two steps. The first step is just the series computation with the matrix expression M+S replaced by a single variable: f = Series[(1 + t x)^(-1), {t, 0, 3}] $1-x t+x^2 t^2-x^3 t^3+O[t]^4$ We need to describe how to expand powers of x. This can be done recursively: power[a_, n_Integer] /; n > 1 := Distribute[a . power[a, ...


9

There is a new function as of version 9 : Series[MatrixFunction[(1 - a*(#))^(-1) &, bigM + bigS], {a, 0, 3}] While the output does not look very pretty it will behave correctly.


9

The Hermite polynomials are orthogonal with respect to the inner product $$\langle f,g \rangle = \int_{-\infty}^{\infty} f(x)g(x)e^{-x^2} \, dx.$$ Thus, the nth coefficient can be computed using the inner product of your polynomial with the nth normalized Hermite polynomial. Example: p[x_] = 1 + x + x^2 + x^3; coeffs = Table[ Integrate[HermiteH[n, ...


9

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 ...


9

There is a straightforward answer analogous to that in Maple : Coefficient[ Sum[t^i, {i, 5}] Sum[t^i, {i, 2, 6}] Sum[t^i, {i, 3, 9}], t, 15] 19 This can be verified by expanding the polynomial: Expand[ Sum[t^i, {i, 5}] Sum[t^i, {i, 2, 6}] Sum[t^i, {i, 3, 9}]] However you can do it in many different ways e.g. by exploiting CoefficientRules or ...


9

@Artes's use of Coefficient certainly seems the most straightforward and probably the best for small examples. If the polynomials have very many terms, the use of SeriesData to represent the polynomials will give better performance. The multiplication of series is efficient in Mathematica. One should note that it is truncated beyond the maximum degree ...


9

It seems, that findExponentialGeneratingFunction would be equivalent to FindGeneratingFunction of the sequence {a1/0!,a2/1!,a3/2!,...}. Therefore findExponentialGeneratingFunction = FindGeneratingFunction[#1/(Factorial /@ Range[0, Length@#1 - 1]), #2] & findExponentialGeneratingFunction[{1,1,1,1,1,1,1,1},x] (* Exp[x] *)


8

For polynomials, you don't need to do any integrals to find the expansion. Take a polynomial p and a list basis containing the basis functions. Then define a function that takes these two, identifies the variable x, and solves for the coefficients in basis that make the two polynomials equal in terms of their CoefficientLists: expandPoly[p_, basis_, x_] := ...


8

In Mathematica 10 you can use SeriesCoefficient and Inactive to get what you require Inactive[Sum][SeriesCoefficient[2/(3(x-1)^3),{x,0,n},Assumptions->n>=0]x^n,{n,0,\[Infinity]}] where Inactive prevents Sum from evaluating. You can then "activate" the Sum as follows Activate[%] to get back to your original expression.


8

The problem is that Total[] works with any head. So: Total[Derivative[1, 2, 1]] (* 4 *) Total[IntegerDigits[k, 2]] (* 2 + k *) And so you can expect Sum[(2 + k) z^k, {k, 0, ∞}] == Sum[Total[IntegerDigits[k, 2]] z^k, {k, 0, ∞}]


8

This does indeed work flawlessly with Mathematica version 8. But in version 10, I had to resort to the following workaround: AbsoluteTiming[ Series[Normal[ Series[Hypergeometric2F1[1, 1 - eps1, 3 - eps, 1/2], {eps1, 0, 1}, {eps, 0, 1}]] /. eps1 -> (eps/2), {eps, 0, 0}]] (* ==> {0.016225, SeriesData[eps, 0, {2 (EulerGamma + PolyGamma[0, ...



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