Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.3K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to merely show an expression rather running it?

Posted 4 years ago

When I used the command "Integrate", it ran a long time, but it didn't get any result yet. So I just want the expression to be showed out rather than running it for saving time. Would you like to tell me how to realize it? Thanks in advance.

POSTED BY: Jacques Ou
5 Replies
Posted 4 years ago

Yes, it works now and it doesn't waste time on the operation without result.

In[278]:= eq56 = (eq54 /. {t -> \[Tau]})*(eq55 /. {t -> t - \[Tau]}) //
    Simplify // Normal

Out[278]= B10 (-B6 + (2 E^(-(B6^2/(4 \[Tau]))) Sqrt[\[Tau]])/
   Sqrt[\[Pi]] + 
   B6 Erf[B6/(2 Sqrt[\[Tau]])]) (-(1/(Sqrt[\[Pi]] Sqrt[t - \[Tau]])) +
    B7 E^(B7^2 (t - \[Tau])) Erfc[B7 Sqrt[t - \[Tau]]])

In[279]:= eq57 = Integrate[eq56, {\[Tau], 0, t}] // Inactivate

Out[279]= 
Inactive[Integrate][
 B10 (-B6 + (2 E^(-(B6^2/(4 \[Tau]))) Sqrt[\[Tau]])/Sqrt[\[Pi]] + 
    B6 Erf[B6/(2 Sqrt[\[Tau]])]) (-(1/(
     Sqrt[\[Pi]] Sqrt[t - \[Tau]])) + 
    B7 E^(B7^2 (t - \[Tau])) Erfc[B7 Sqrt[t - \[Tau]]]), {\[Tau], 0, 
  t}]
POSTED BY: Jacques Ou
Posted 4 years ago

As Rohit has shown Inactivate does what Zhonghui asked for. But Inactive does not. What is the difference between the two functions? Lets check the documentation:

Inactivate

Inactivate[expr] replaces all instances of f with Inactive[f] for symbols f used as heads in expr.

Inactive

Inactive[f] is an inactive form of f.

Well, the difference between Inactivate and Inactive is not easy to understand

POSTED BY: Hans Milton
Posted 4 years ago

If the integrand is complicated, and it needs to be written out firstly and then it will be integrated. If I have done as you suggested, it would be

In[85]:= eq1 = -A6 (1/(Sqrt[\[Pi]] Sqrt[t]) - 
    A8 E^(A8^2 t) Erfc[A8 Sqrt[t]]) Erfc[A7/(2 Sqrt[-t + T])]

Out[85]= -A6 (1/(Sqrt[\[Pi]] Sqrt[t]) - 
   A8 E^(A8^2 t) Erfc[A8 Sqrt[t]]) Erfc[A7/(2 Sqrt[-t + T])]

In[87]:= eq2 = HoldForm[Integrate[eq1, {t, 0, T}]]

Out[87]= \!\(
TagBox[
RowBox[{
SubsuperscriptBox["\[Integral]", "0", "T"], 
RowBox[{"eq1", 
RowBox[{"\[DifferentialD]", "t"}]}]}],
HoldForm]\)

which is not what I wanted. What I wanted is

\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(T\)]\(\(\(-A6\)\ \((
\*FractionBox[\(1\), \(
\*SqrtBox[\(\[Pi]\)]\ 
\*SqrtBox[\(t\)]\)] - A8\ 
\*SuperscriptBox[\(E\), \(
\*SuperscriptBox[\(A8\), \(2\)]\ t\)]\ Erfc[A8\ 
\*SqrtBox[\(t\)]])\)\ Erfc[
\*FractionBox[\(A7\), \(2\ 
\*SqrtBox[\(\(-t\) + T\)]\)]]\) \[DifferentialD]t\)\)
POSTED BY: Jacques Ou
Posted 4 years ago

Hi Zhonghui,

Try this

Integrate[eq1, {t, 0, T}] // Inactivate
POSTED BY: Rohit Namjoshi
Posted 4 years ago

Will this do what you want?

HoldForm[Integrate[x^2,{x,1,3}]]+Sin[z]
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard