Mathematica Integrate gives back the integrand - wolfram-mathematica

i'm trying to Integrate the following function:
(q (1 + q) - E^-q Sinh[q])/(-q + Cosh[q] Sinh[q]) - (
2 q Tanh[q])/(-q + Cosh[q] Sinh[q])
I already solved it numerically but i really need the indefinite integral so used:
In[67]:= Integrate[(
q (1 + q) - E^-q Sinh[q])/(-q + Cosh[q] Sinh[q]) - (
2 q Tanh[q])/(-q + Cosh[q] Sinh[q]), q]
but as output i get back the integrand again:
Out[67]= \[Integral]((
q (1 + q) - E^-q Sinh[q])/(-q + Cosh[q] Sinh[q]) - (
2 q Tanh[q])/(-q + Cosh[q] Sinh[q])) \[DifferentialD]q
any suggestions on how to perform this computation correctly?
thanks in advance

You can decompose this integral:
eq = (q (1 + q) - E^-q Sinh[q])/(-q +
Cosh[q] Sinh[q]) - (2 q Tanh[q])/(-q + Cosh[q] Sinh[q]);
Integrate[#, q] & /# Simplify /# Expand[eq]
One part of this integral can be done, rest contains simplest, but still no expressed in standard mathematical functions integrals.
You can do these integrals numerically, or search approximated form, for example using series expansion.
Exemplary series expansion you can find on link:
wolframalpha.com

Related

Mathematica: Leaving as constants

I was going to simplify an equation with three variables (s, a, b) using Mathematica as follows:
In[3]:= f[s_] := ((1/4)*(s + s^2 + s^3 + s^4)*[a*(s^3 - s) +
b*(s^3 - s^2)])/(s^3 - (1/4)*(s + s^2 + s^3 + s^4))
In[4]:= Simplify[f[s_]]
Out[4]:= s_ (1 + s_ + s_^2)
As you can see, in the simplified version does not have 'a' and 'b'. I am sure that they should not be removed during simplification process. I am wondering what I am missing...
Thank you in advance!!!
Square brackets have very precise meaning in Mathematica and can't be used in place of parens. Likewise underscores can only be used in very specific ways.
Try this
f[s_] := (1/4*(s+s^2+s^3+s^4)*(a*(s^3-s)+b*(s^3-s^2)))/(s^3-1/4*(s+s^2+s^3+s^4));
Simplify[f[s]]
which gives you this
-((s*(a + a*s + b*s)*(1 + s + s^2 + s^3))/(-1 - 2*s + s^2))

How can I ask Wolfram Alpha to rearrange an equation?

I have an equation (parentheses are used because of VBA code)
Y=(P/(12E((bt^3)/12))*A
and i know every variables but not "b". Is there any way how to ask Wolfram Alpha to "redefine" (not solve) equation so I can see something like following: I tried to do it manually (but result is not OK)
b=((P/EY)*12A))/t^3
I wish to see how right equation will look.
Original equation is on picture below
where
equation in [,] I simplified by A
I'm not sure if there's a way to tell Wolfram|Alpha to rearrange for a particular variable; in general it will usually try to rearrange for x or y.
If I substitute b for x in your equation and use the following query:
solve Y - (P/(12E((xt^3)/12))*A) = 0
then Wolfram Alpha returns the result you're looking for: x (b) expressed in terms of the other variables. Specifically:
x = A P / (E t^3 Y) for tY != 0 and AP != 0
I know that your question was about Wolfram Alpha, that you do not want to "solve", but here is one way you could do it in Mathematica using your real question. I renamed I into J because I is a reserved symbol in Mathematica for the imaginary unit.
J = b t^3/12;
expr = (P / (12 E J) ) (4 L1^3 + 3 R ( 2 Pi L1^2 + Pi R^2 + 8 L1 R ) + 12 L2 (L1 + R)^2)
Solve[ Y == expr , b]
Result
{{b -> (P (4 L1^3 + 12 L1^2 L2 + 24 L1 L2 R + 6 L1^2 \[Pi] R + 24 L1 R^2 + 12 L2 R^2 + 3 \[Pi] R^3))/(E t^3 Y)}}

mathematica, Simplify trig function

if say i have a function given :
singlepattern = Cosh[theta] + Cosh[3theta]
How do i get a rational expression in terms of x of the function if i want to substitute Cosh[theta] by
"Cosh[theta] = ( x )/ 2 "
expression?
I retagged the question as a homework. You should look into ChebyshevT polynomials. It has the property that ChebyshevT[3, Cos[th] ]==Cos[3*th]. So for your problem the answer is
In[236]:= x/2 + ChebyshevT[3, x/2]
Out[236]= -x + x^3/2
Alternatively, you could use TrigExpand:
In[237]:= Cos[th] + Cos[3*th] // TrigExpand
Out[237]= Cos[th] + Cos[th]^3 - 3 Cos[th] Sin[th]^2
In[238]:= % /. Sin[th]^2 -> 1 - Cos[th]^2 // Expand
Out[238]= -2 Cos[th] + 4 Cos[th]^3
In[239]:= % /. Cos[th] -> x/2
Out[239]= -x + x^3/2
EDIT The reason the above has to do with the explicit question, is that Cosh[theta] == Cos[I*u] for some u. And since u or theta are formal, results will hold true.
Use Solve to solve for theta, then substitute, Expand, and Simplify:
In[16]:= TrigExpand[Cosh[3 theta] + Cosh[theta]] /.
Solve[Cosh[theta] == (x)/2, theta] // FullSimplify
During evaluation of In[16]:= Solve::ifun: Inverse functions are being used by Solve,
so some solutions may not be found; use Reduce for complete solution information. >>
Out[16]= {1/2 x (-2 + x^2), 1/2 x (-2 + x^2)}
This might interest you:
http://www.wolframalpha.com/input/?i=cosh%28x%29+%2B+cosh%283*x%29

How to get rid of denominator in numerator and denominator in mathematica

I have the following expression
(-1 + 1/p)^B/(-1 + (-1 + 1/p)^(A + B))
How can I multiply both the denominator and numberator by p^(A+B), i.e. to get rid of the denominators in both numerator and denominator? I tried varous Expand, Factor, Simplify etc. but none of them worked.
Thanks!
I must say I did not understand the original question. However, while trying to understand the intriguing solution given by belisarius I came up with the following:
expr = (-1 + 1/p)^B/(-1 + (-1 + 1/p)^(A + B));
Together#(PowerExpand#FunctionExpand#Numerator#expr/
PowerExpand#FunctionExpand#Denominator#expr)
Output (as given by belisarius):
Alternatively:
PowerExpand#FunctionExpand#Numerator#expr/PowerExpand#
FunctionExpand#Denominator#expr
gives
or
FunctionExpand#Numerator#expr/FunctionExpand#Denominator#expr
Thanks to belisarius for another nice lesson in the power of Mma.
If I understand you question, you may teach Mma some algebra:
r = {(k__ + Power[a_, b_]) Power[c_, b_] -> (k Power[c, b] + Power[a c, b]),
p_^(a_ + b_) q_^a_ -> p^b ( q p)^(a),
(a_ + b_) c_ -> (a c + b c)
}
and then define
s1 = ((-1 + 1/p)^B/(-1 + (-1 + 1/p)^(A + B)))
f[a_, c_] := (Numerator[a ] c //. r)/(Denominator[a ] c //. r)
So that
f[s1, p^(A + B)]
is
((1 - p)^B*p^A)/((1 - p)^(A + B) - p^(A + B))
Simplify should work, but in your case it doesn't make sense to multiply numerator and denominator by p^(A+B), it doesn't cancel denominators

FullSimply Inequalities and then rearranging them in Mathematica 7

I am using Mathematica 7 in the notebook interface and I want to rearrange an inequality so that I get a certain variable on one side. For eg.
FullSimplify[x^3+L+r>3x^3+2r]
Gives
L > r + 2 x^3
However, I want :
r < L-2x^3
Is there anyway we can instruct FullSimplify to order variables in a particular way? I am using Mathematica for presentation as well so, the way I arrange the variables is important to me.
Thanks
SR
Edit: I tried Reduce, while that works for this example, it does not work for the actual expression I have, I get an error saying,
This system cannot be solved with the methods available to Reduce.
Edit: here is the actual expression:
{L - (m^2 ((-2 + e)^2 \[Delta] + (5 +
2 e (-7 + 4 e)) \[Tau]) \[Omega])/(36 (2 - 3 e + e^2)^2)} > {0}
I want this to be displayed in the form of \[delta]< *something*
Thanks!
First of all, getting Mathematica to output something exactly as you would like it is something of a black art, and requires a lot of patience. That said, if you apply Reduce to your original expression, as per Belisarius, you'd get
In[1]:=Reduce[x^3 + L + r > 3 x^3 + 2 r, r, Reals]
Out[1]:= r < L - 2 x^3
However, as you pointed out, this isn't the full expression, and Reduce produces what can only be described as a less than helpful answer when applied to it. It is at this point where patience and a lot of extra processing is required. I'd start with
In[2]:=Reduce[ <full expression>, Delta, Reals] // LogicalExpand // Simplify
While this doesn't give you a clean answer, it is better than before and reveals more of the structure of your solution. (I would not use FullSimplify as that mixes Delta in with the other terms.) At this point, we need to know more about the terms themselves, and the output from In[2] is not quite as useful as we want.
I'd re-expand this with LogicalExpand which gives you twelve terms that are significantly simpler than the what Reduce alone gives. (You'll note that only the last six terms actually involve Delta, so I'd check that the variable conditions actually match those.) Selecting those last six terms only,
In[3]:=%2[[-6;;]] // Simplify
Out[3]:= m != 0
&& ((Omega > 0 && Delta < something) || (Omega > 0 && Delta < something else)
&& (1 < e < 2 || e < 1 || e > 2)
The third term is tautological, but Simplify nor FullSimplify can't seem to remove it. And we're really only interested in the middle term anyway. If Omega > 0 your expression can then be extracted via %[[2,1,2]].
Putting this all together in one expression:
In[4]:=Simplify[LogicalExpand[Reduce[<expression>, Delta, Reals]]][[-6;;]] //
Simplify // #[[2,1,2]]&
Out[4]:= Delta < something
After writing that out, I realized that there is a much simpler way to approach this. I'd redo line 2, above, as follows:
In[5]:= Reduce[ <full expression>, Delta, Reals] // LogicalExpand // Simplify //
Cases[#, ___ && Delta < _ && ___, Infinity]&
Out[5]:= {Omega > 0 && Delta < something}
Or, provided you really do know that m != 0 and Omega > 0 you can do
In[6]:= Reduce[ <expr> && m!=0 && Omega > 0, Delta, Reals ] // LogicalExpand //
Simplify // #[[2]]&
Reduce[x^3 + L + r > 3 x^3 + 2 r, r, Reals]
Will do.
As I don't use Mathematica for editing or presentation, perhaps someone else may come with some extra advice.
Edit
based on your comment, you may try:
Reduce[{L - (m^2 ((-2 + e)^2 Delta + (5 +
2 e (-7 + 4 e)) Tau) Omega)/(36 (2 - 3 e + e^2)^2) > 0}, Delta, Reals]
Where I corrected some syntax errors. But you'll find that the resulting expression is rather unpleasant. To simplify it further you need to know the valid ranges for your vars. Please post that info if you have it.
HTH!
Inspect the output of
r=Simplify[Reduce[L-(m^2((-2+e)^2\\[Delta]+(5+2e(-7+4e))\\[Tau])\\[Omega])/(36(2-3e+e^2)^2)>0,\\[Delta],Reals]]
to see that
r[[2,1,1,1]] gives \\[Delta]>expr,
but
r[[2, 1, 2, 2]] gives \\[Delta]< expr,
because the sign of \[Omega] in the denominator of expr. All this ignores the other conditions on the values of L, e, m and \[Omega] that will change the result and different versions of Mathematica may change the form of the result from Simplify[Reduce[]] which will invalidate all of this.
Part of the difficulty in reducing the expressions returned by Reduce[] and LogicalExpand[] is that the supplied expression involves division by zero when e=1 or =2.
I get something bearably compact with
Assuming[{
(L | m | e | Tau | Omega | Delta) \[Element] Reals
},
FullSimplify[
LogicalExpand[
Reduce[{L - (m^2 ((-2 + e)^2 Delta + (5 +
2 e (-7 + 4 e)) Tau) Omega)/(36 (2 - 3 e + e^2)^2) >
0}, Delta, Reals]
]
]
]
Out[]:= (L > 0 && (1 < e < 2 || e < 1 || e > 2) && (m == 0 || Omega == 0)) ||
(m != 0 && (
(Omega > 0 &&
Delta < (36 (-1 + e)^2 L)/(m^2 Omega) + ((-5 + 2 (7 - 4 e) e) Tau)/(-2 + e)^2) ||
(Delta > (36 (-1 + e)^2 L)/(m^2 Omega) + ((-5 + 2 (7 - 4 e) e) Tau)/(-2 + e)^2 &&
Omega < 0)) &&
(e > 2 || e < 1 || 1 < e < 2))
where I've expended no effort to replace symbol names with symbols.
(Why Assuming[...]? Because I'm too lazy to remember to get the same assumptions jammed into each simplification step.)

Resources