# Tag Info

2

You mean something like this? m = 10; gammaRD = ConstantArray[RandomReal[], {m}]; gammaIR = ConstantArray[RandomReal[], {m}]; gammaSR = ConstantArray[RandomReal[], {m}]; L1 = 3; z = 5; y = Product[ 1 - Exp[-z/gammaRD[[i]]] gammaSR[[i]]/(gammaIR[[i]] + gammaSR[[i]]) L1, {i,1,m}]; N[%] (*0.989724106426077*)

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

(Updated to handle fractional powers) Here's another way to take advantage of SeriesData. The data has the format SeriesData[x, x0, {a0, a1,...}, min, max, den] The coefficient a0 corresponds to the power (x - x0)^(min/den), a1 to the power (x - x0)^((min+1)/den), etc. To get the terms from some point start, drop the initial coefficients and change ...

2

The built-inSeriesCoefficientis useful to give directly the desired expansion coefficient, for not too complicated functionsf[x]. ExpandSeries[f_, {x0_, h_, t_}] := With[{s=SeriesCoefficient[f, {x, x0, n}, Assumptions :> n>=0], r=Range[h, t]}, (s /. n -> r).(x - x0)^r] Try Expand[ExpandSeries[x / (1 - x - x^2), {0, 8, 13}]] to see ...

4

I will use the function Exp[x] to demonstrate in a simple way how you can do it. If you try FullForm[Series[Exp[x], {x, x0, 5}]] you will get SeriesData[x,x0,List[Power[E,x0], Power[E,x0], Times[ Rational[1,2], Power[E,x0]], Times[ Rational[1,6], Power[E,x0]],Times[ Rational[1,24],Power[E,x0]], Times[ ...

5

Edit You changed your equations after accepting this answer. The same method works: First we modify your functions to get some speed: Y1[0] = 2 + r; Y2[0] = 4 - r; Y3[0] = 2 + r; Y4[0] = 4 - r; Y1[k_] := Y1[k] = FullSimplify[(k - 1)!/(k!)*(Y3[k - 1])]; Y2[k_] := Y2[k] = FullSimplify[(k - 1)!/(k!)*(Y4[k - 1])]; Y3[k_] := Y3[k] = FullSimplify[(k - ...

2

The first error says it all. Your S[x,l] does not converge in $x=0$ for $l \ge 3$. Note that evaluating the function in $x=0$ is the first step in computing its series about this point. If you remove the GenerateConditions -> False option, you will notice that the integration produces some result invalid for $x=0$. By forcing Mathematica to forget this ...

3

Here's another way, if the ys all appear in the denominator. We convert the expression to a polynomial with y -> 1/u and use some of the polynomial functions. expr1 = x + (2 x^2)/y - (3 x^3)/y^2; FromCoefficientRules[ MapAt[Abs, CoefficientRules[expr1 /. y -> 1/u, {x, u}], {All, {-1}}], {x, 1/y}] (* x + (3 x^3)/y^2 + (2 x^2)/y *) Another ...

1

expr1 = x + (2 x^2)/y - (3 x^3)/y^2; Now: expr1 /. {Times[n_?Negative, c_] :> Times[-1 n, c], Rational[-1, d_] :> Rational[1, d]} Gives: x + (3 x^3)/y^2 + (2 x^2)/y UPDATE If there are standalone numbers in the series as in e.g. expr2 = -2 + x + (2 x^2)/y - (3 x^3)/y^2; Then the following more general solution should be used: ...

5

Well you can begin by wrapping your expression in Hold or HoldForm then using ReleaseHold when you want to Evaluate them. For your first example: expr = HoldForm[1 + x + (x^2)/2! + (x^3)/3! + (x^4)/4! + (x^5)/5!] Now you can do: Replace[expr /. {Times[c : Power[x, n_?OddQ], d_] :> Times[-1, c, d]}, x -> - x, 2] To get: 1 - x + x^2/2! - x^3/3! + ...

Top 50 recent answers are included