1

I am a beginner in Mathematica. I want to plot for

t = 5

f[x_] = Integrate[Sqrt[ Tanh[x]], x]

r[x_] = Integrate[Cos[f[x]], x]

Plot[r[x], {x, -t, t}, 
  AxesLabel -> {"x"}, 
  PlotLabel -> "y", 
  PlotRange -> All, 
  PlotPoints -> 500]

but I'm getting error messages:

Integrate::ilim: Invalid integration variable or limit(s) in -4.99998. >>
Integrate::ilim: Invalid integration variable or limit(s) in -4.97994. >>
Integrate::ilim: Invalid integration variable or limit(s) in -4.9599. >>

Anyone knows a solution?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
svar4ik
  • 13
  • 1
  • 3
  • 1
  • You should do Clear[x] before this code. 2) A more general tip is to learn the difference between = and :=, especially for function definitions like f and r. 3) And finally, the RHS of r[x] is asking Mathematica to compute an antiderivative for `Cos[-ArcTan[Sqrt[Tanh[x]]] - 1/2 Log[1 - Sqrt[Tanh[x]]] +
  • 1/2 Log[1 + Sqrt[Tanh[x]]](which is what I get forCos[f[x]]), and this is probably too much to ask. So look intoNIntegrate` instead.

    – Marius Ladegård Meyer May 21 '17 at 21:00