# Mathematica empty plots problem [RESOLVED] [closed]

Two of my homework problems don't want to get plotted.. I keep getting empty graphs with only the two axes:

And for the second one:

UPDATED TEXT VERSION:

In[114]:= Clear[h]

In[177]:= h[x_]:=(1-Log[x])/(E^(1/x))
In[178]:= Limit[h[x], x->0, Direction->FromAbove]
Out[178]= ConditionalExpression[0,ln∈&&Log[e]>0]
In[179]:= Plot [h[x],{x, 0, 4}]
Out[179]=


Second one:

In[133]:= Clear [g]
g[x_]:=(1/x)-Log[x]
In[180]:= Limit[g[x], x-> 0, Direction-> FromAbove]
Out[180]= ∞
In[181]:= Plot [g[x],{x, 0, 3}]
Out[181]=

• Use Log instead of ln and E instead of e, and brackets [] instead of parentheses () for functions. – Carl Woll Oct 31 '18 at 1:17
• Be patient... post the code in text format – J42161217 Oct 31 '18 at 1:18
• As in @CarlWoll's hint, Mathematica is case sensitive and built-in functions are capitalized. – Chris K Oct 31 '18 at 1:25
• I added the text version – Youssef Oct 31 '18 at 1:41
• Nvm fixed. Thanks enano – Youssef Oct 31 '18 at 2:15

Not to do your homework for you, I have made an edit to your first problem to make it work (changed the numbers so you have to implement it yourself, but it should give an idea).

Clear[h]
(* Use () instead of [] for ordering *)
h[x_] := (13 - Log[5 * x])/E^(1 / x^2);


Now you can look at why Direction wasn't working properly for you. If you read the error message and look at the documentation for the Limit function you will see that FromAbove is not a supported value, nor is it something that Mathematica even knows about.

(* the values of the Direction option are + or - 1, you can play around with the below *)
Limit[h[x], x -> 0, Direction -> -1]


Then with the above modifications, the Plot call evaluates properly.

(* this just works with the modifications to h[x_] *)
Plot[h[x], {x, 0, 4}]


Things to take away:

1. The coloring of things in a notebook can give you hints about what is going on. The fact that FromAbove was blue means that it doesn't have a value.

2. When a message is issued, read it carefully and try to figure out what it means. Google and other resources are your friend.

3. Read about WL syntax, square brackets [] are only for calls to/defining functions, not for ordering expressions, use regular parens for that ().

4. Good luck on your homework! Try to watch some Mathematica/Wolfram Language instructional videos. In fact Stephen Wolfram has an excellent guide to starting to use the language. It is available from free online right here at this link.

• Works! Thanks a lot! – Youssef Oct 31 '18 at 2:16
• "FromAbove" is equivalent to -1 and "FromBelow" is equivalent to +1 (Note: presence of quotes) – Bob Hanlon Oct 31 '18 at 2:50
• Thanks @BobHanlon, I often find it frustrating when I can't remember if a value needs to be string-valued or a symbol. This was one of those cases. I could swear I had seen them before, but clearly the symbol FromAbove was not defined. Thanks for pointing that out! – enano9314 Oct 31 '18 at 4:57