Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a solution to an ODE (which I call sol), which I would like to expand in terms of Log[1+x] around x=-1. I thought that:

Series[y[x] /. sol, {Log[1+x], -1, 6}]

would do the trick, but it doesn't seem to work. That isn't too much of a problem, because if I just do:

 Series[y[x] /. sol, {x, -1, 6}]

and I can spot the Log terms myself. It would be very useful though if rather than having an analytic expansion (I get constants in terms of Bessel functions and so on) if I could just get numerical values (i.e. approximate decimal representations) of the terms in the expansion.

For concreteness rather than:

$\frac{2 (\log (x+1)+\gamma -\log (2))}{\pi }-\frac{(x+1)^2 (\log (x+1)+\gamma -1-\log (2))}{2 \pi }+O\left((x+1)^4\right)$

i'd like something like:

1.234 Log[1+x] + 23.321 (1+x)^2 Log[1+x] etc.

Thankyou

share|improve this question
1  
Try multiplying everything by 1.0. –  b.gatessucks May 7 '13 at 19:43
    
that returns ${1.3765 Y_0(x+1)-0.60384 Y_0(x+1)}$ though actually, if I then series expand BesselY that would be fine. Thankyou, I feel stupid but you answred my question very fast! EDIT: My mistake, that works perfectly –  user5866 May 7 '13 at 19:45
2  
N[] works, too. –  J. M. May 7 '13 at 19:56
    
Use Normal to get rid of the O[ ] part. –  Sjoerd C. de Vries May 7 '13 at 20:03
    
A great improvement to these responses would be to explain how one might go about automating the extraction of the coefficients of the Log terms, if that's possible...as in I'd like to get a list of {1.234,23.321,....} etc. I know I didn't ask for it, but I'm sure its the sort of thing other people would like to do as well. Many thanks, anyway. –  user5866 May 8 '13 at 3:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.