Re: How to simplify?
- To: mathgroup at smc.vnet.net
- Subject: [mg96224] Re: [mg96161] How to simplify?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 9 Feb 2009 05:38:36 -0500 (EST)
- Reply-to: hanlonr at cox.net
S[r_] := 1/2 r BesselJ[1, r]; S2[r_] = y[r] /. DSolve[ y''[r] + 1/r y'[r] + S[r] == BesselJ[0, r], y[r], r][[1]] // FullSimplify C[1]*Log[r] + C[2] + (r*BesselJ[1, r])/2 - 1 You can get the desired result by setting the arbitrary constants to the obvious values S2[r] /. {C[1] -> 0, C[2] -> 1} (r*BesselJ[1, r])/2 Or more generally, Reduce[S[r] == S2[r]] (Log[r] == 0 && C[2] == 1) || (Log[r] != 0 && C[1] == (1 - C[2])/Log[r]) S2[r] /. C[1] -> (1 - C[2])/Log[r] (r*BesselJ[1, r])/2 Or use boundary conditions that are consistent with the desired results DSolve[{y''[r] + 1/r y'[r] + S[r] == BesselJ[0, r], y[1] == (BesselJ[1, 1])/2, y'[1] == BesselJ[0, 1]/2}, y[r], r][[1]] // FullSimplify {y[r] -> (r*BesselJ[1, r])/2} Bob Hanlon ---- Aaron Fude <aaronfude at gmail.com> wrote: ============= Hi, I'm sorry for totally belaboring this point, but I am having a hard time getting Mathematica be useful for me in this one respect. The following code shows that the linear ODE that I am trying to solve has 1/2 r BesselJ[1, r] as the particular solution. DSolve, however, returns an answer that I'm sure is correct. I tested it - numerically, the particular part is exactly 1/2 r BesselJ[1, r]. But for someone who is looking for analytical insight, the answer is not useful. What can be done to simplify the expression so that it appears as 1/2 r BesselJ[1, r] S[r_] := 1/2 r BesselJ[1, r]; D[S[r], {r, 2}] + 1/r D[S[r], r] + S[r] // FullSimplify DSolve[y''[r] + 1/r y'[r] + S[r] == BesselJ[0, r], y[r], r] // FullSimplify I will gladly accept the answer "Nothing" and move on to looking for alternative solutions. Also note, this is just a model problem for me in preparation for more complicated ones. Last time I got several responses that said - "if you already know the solution to this problem, why are you trying to solve it?" Many thanks in advance, Aaron -- Bob Hanlon