# Plot a function which is dependent from an indefinite integral

I have a function which is:

Sqrt/π Exp[y] Integrate[
(p Cos[β y] + β q Sin[β y]) Sqrt[1 + β^2]/(p^2 + β^2 q^2),
{β, 0, ∞}
]


with

p = Sqrt[3*(1 + β^2)] Cosh[τ1 Sqrt[(1 + β^2)]] + 2 Sinh[τ1*Sqrt[(1 + β^2)]]


and

q = Sinh[τ1 Sqrt[(1 + β^2)]]


Is it possible to plot this function? I'm trying to put the expression of out[y] in Plot, but it seems that it does not work.

• Tau1 is a number. – Francesco_Lobosco Jun 3 '18 at 7:17
• Please edit your question to show us the code you are trying to use to Plot and the error you get. Include all the relevant variable values. All relevant information necessary to reproduce your problem should go in the question not the comments. – rhermans Jun 3 '18 at 8:57

Try something like this,

\[Tau]1 = 1;

p = Sqrt[3*(1 + \[Beta]^2)]*Cosh[\[Tau]1*Sqrt[(1 + \[Beta]^2)]] +
2*Sinh[\[Tau]1*Sqrt[(1 + \[Beta]^2)]];

q = Sinh[\[Tau]1*Sqrt[(1 + \[Beta]^2)]];

out[y_,N1_] :=
Sqrt/Pi*Exp[y]*
NIntegrate[(p*Cos[\[Beta]*y] + \[Beta]*q*Sin[\[Beta]*y])*
Sqrt[1 + \[Beta]^2]/(p^2 + \[Beta]^2*q^2), {\[Beta], 0, N1}]

Plot[out[y,10], {y, 0, 1}] • It seems that it works and it gives me the results that i want! Thank you! Could you explain me why it does not work with Infinity instead of N1? Just to not do the same error in the future. – Francesco_Lobosco Jun 3 '18 at 7:40
• P.s. may i ask you another question? I have a system of two partial differential equation to solve and i want to increase the density of point (the solutions have to be evaluated numerically): is this possible in the NDSolve function? – Francesco_Lobosco Jun 3 '18 at 7:42
• @Francesco_Lobosco It's very time consuming so I choose a finite upper limit. – zhk Jun 3 '18 at 10:47
• @Francesco_Lobosco You can ask this new question in a new post. – zhk Jun 3 '18 at 10:48