Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5613
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Making a function out of repeated hyperbola integrations? |
| Date | 2011-10-12 07:48 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j73gon$fv2$1@smc.vnet.net> (permalink) |
I don't get your first result, and ignoring that, I'm not sure which of
the two following solutions is what you want. The second is slow.
Leaving out Assumptions makes all of it REALLY slow, and the results would
be ConditionalExpression instances.
ClearAll[f, n, k]
f[1, n_] =
Integrate[n/x - a, {x, a, n/a}, Assumptions -> {n > a^2, a > 0}]
f[k_, n_] =
Integrate[n/x^k - a, {x, a, n/a},
Assumptions -> {n > a^2, a > 0, k \[Element] Integers, k > 0}]
a^2 - n + n Log[n/a^2]
a^2 - n - ((a^(1 - k) - (a/n)^(-1 + k)) n)/(1 - k)
ClearAll[f, n, k]
f[1, n_] =
Integrate[n/x - a, {x, a, n/a}, Assumptions -> {n > a^2, a > 0}];
f[k_, n_] /; k > 1 :=
f[k, n] =
FullSimplify[
Integrate[f[k - 1, n/x], {x, a, n/a},
Assumptions -> {a > 0, n > a^2}], {a > 0, n > a^2}]
Table[f[k, n], {k, 1, 3}]
{a^2 - n + n Log[n/a^2], -a^3 + a n +
Log[a^2/n] (n + 2 n Log[a] - 1/2 n Log[n]), (1/(
2 a^2))(a^2 - n) (2 ((-2 + a) a^3 + 3 n - 2 a n) + 8 n Log[a] -
2 n Log[n] + a (-a^2 + n) Log[n/a^2])}
Bobby
On Tue, 11 Oct 2011 03:24:30 -0500, Nathan McKenzie <kenzidelx@gmail.com>
wrote:
> I'm working with the following repeated integrals. Is there any way
> to automate what I'm doing here?
>
> I start with this:
>
> Integrate[ n/x - a, {x, a, n/a}]
>
> The result of that (after a bit of text editing) is a^2 - n Log[a] + n
> (-1 + Log[n/a]). That's the first result I want to work with. Then, I
> currently manually edit that result by swapping out n with (n/x), and
> have
>
> Integrate[ a^2 - (n/x) Log[a] + (n/x) (-1 + Log[(n/x)/a]), {x, a, n/
> a}]
>
> And that resolves to -a^3 + n Log[a] + n Log[a]^2 + 1/2 n Log[n/a^2]^2
> + n (a - (1 + Log[a]) Log[n/a]). Which is the second result I want
> to work with. The, I manually swap out n with (n/x) and integrate
> again on {x, a, n/a}, and repeat this process ad nauseum. It doesn't
> take long before the number of n's for me to edit becomes really
> unwieldy and error prone... and ideally I would like to do this many
> times in a row (say, up 30 or 40) and have the results around for
> random use in other contexts.
>
> What I would really like to be able to do is just have some sort of
> function where I can type F[n,a,s], where s is the number of times
> integration is performed, and then n and a (which will be actual
> numbers) will get evaluated. I feel like the step where I swap out n
> with (n/x) points at something problematic, though. Is there any way
> in Mathematica for me to construct such a function and get my results
> automatically?
>
--
DrMajorBob@yahoo.com
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Making a function out of repeated hyperbola integrations? DrMajorBob <btreat1@austin.rr.com> - 2011-10-12 07:48 +0000
csiph-web