# ParametricPlot problems

I have the following code:

$Assumptions -> {b = 1, Element[r, reals], r > 0} gtt[r_] := -((r + b)/(r - 3 b))^((-3/2)) (r^2 + 6 b r + 21 b^2) grr[r_] := ((r + b)/(r - 3 b))^(3/2) (r^2 + 6 b r + 21 b^2)^-1 g[r_] := -(((r + b)/(r - 3 b))^(3/2) (r - 3 b)^2)^2 B[r_] := ((gtt[r])^-1 (grr[r])^-1 Sqrt[-g[r]]) p[r_] = D[B[r], r] q[r_] := ((grr[r])^-1 Sqrt[-g[r]]) z[r] = Integrate[-(gtt[r])^-1, r] ParametricPlot[{{V[r]}, {z[r]}}, {r, -100, 100}] V[r_] = 3/4 (B[r])^-2 (gtt[r])^2 (p[r])^2 - 1/2 (B[r])^-1 (gtt[r])^2 D[p[r], r] - 1/2 (B[r])^-2 (gtt[r]) D[q[r], r] p[r]  I have two questions: $$1:$$ I evaluated the integral (I will not post the result as it was very long and complicated), but when I tried to use the limits(r to infinity), the integral would not evaluate, however when I just gave the command to integrate without the limits it gave me a result. Why did this happen and will it be the correct result? $$2:$$ I want to use ParametricPlot to plot $$V[z]$$ but so far I am unsuccessful and I am unsure if it is because of a problem with the integral or because I am implementing ParametricPlot incorrectly. What I tried is this ParametricPlot[{{V[r]},{z[r]}},{r,-100,100}]  I also tried it the other way around but either way I get a graph appearing but nothing being plotted on it. Also the range of the graph is always between 1 and -1. Does anyone have any idea? Thank you! • Please show your code. It will make it easier for people to check it and suggest solutions. The ParametricPlot command is not correct as written. It requires two functions, say$x(t)$and$y(t)$, to produce an$xy$plot with parameter$t$. Your$V(r)$also contains the undefined functions$B$and$p\$. – Themis Dec 17 '18 at 12:16
• Is the code given in terms of Mathematia' syntax? If not, please provide a MMA code. – Tugrul Temel Dec 17 '18 at 18:38
• \frac{3}{4} is no Mathematica code! – Ulrich Neumann Dec 17 '18 at 20:42
• I.e., what they're saying is they'd be happy to help, but they want you to do your part, which means: (a) present all your code as Mathematica code; e.g.,  \frac{r + b}{r - 3 b} is LaTeX; (r+b)/(r-3 b) is Mathematica; (b) fix the unmatched parentheses in g[r_]; and (c) give the exact code for the definite integral (i.e., with the limits) that you say wouldn't evaluate. – theorist Dec 20 '18 at 4:26
• Hello, sorry I was away for a week and so have been unable to update. I have chaged that now I hope it is a little clearer – Claire.Bear Dec 24 '18 at 11:45

You seriously need to go through the documentation. There are some very trivial mistakes (maybe typo!)

Apart from that, only tricks you need here is to use Re for V[r] and scale it properly to make it look good.

b = 1
gtt[r_] := -((r + b)/(r - 3 b))^((-3/2)) (r^2 + 6 b r + 21 b^2)
grr[r_] := ((r + b)/(r - 3 b))^(3/2) (r^2 + 6 b r + 21 b^2)^-1
g[r_] := -(((r + b)/(r - 3 b))^(3/2) (r - 3 b)^2)^2
B[r_] := ((gtt[r])^-1 (grr[r])^-1 Sqrt[-g[r]])
p[r_] = D[B[r], r];
q[r_] := ((grr[r])^-1 Sqrt[-g[r]])
z[r_] = Integrate[-(gtt[r])^-1, r];
V[r_] = 3/4 (B[r])^-2 (gtt[r])^2 (p[r])^2
- 1/2 (B[r])^-1 (gtt[r])^2 D[p[r], r]
- 1/2 (B[r])^-2 (gtt[r]) D[q[r], r] p[r];

ParametricPlot[Re@{V[r]/10^5, z[r]}, {r, -100, 100}]


• Thank you so much, I am very new to mathematica, I only began using it this month so I have a lot to learn! Just so I know, what trivial mistakes to you mean exactly? – Claire.Bear Jan 3 at 15:17
• @Claire.Bear, its fine. We all have our first time. My first question was eventually removed after some time (it was dumb :p). I got some error when I copied your initial question (for example you used reals not Reals`) and I wrote the lines from scratch. But probably they are typos - so don't worry. Always keep your eyes open for Caps and brackets. Enjoy :) – Sumit Jan 4 at 9:44