Message Boards Message Boards

Drawing tangent line on x*Log[Abs[x]]

GROUPS:

Hello,

i want to draw x*Log[Abs[x]] with it tangent to show it approaches infinity in zero.

I tried with this :

Manipulate[
 Show[
  Plot[x*Log[Abs[x]], {x, -1, 1}, PlotRange -> All],
  Plot[g'[p] (x - p) + g[p], {x, p - 1, p + 1}, 
   PlotStyle -> {Thick, Orange}, PlotRange -> All]]

 , {p, -1, 1}]

But it don't show the tangent with this error :

General::stop: Further output of Infinity::indet will be suppressed during this calculation.
Infinity::indet: Indeterminate expression 0 (-\[Infinity]) encountered.

How can I do that on Mathematica to show this tangent with the discontinuity in zero ?

Thanks for help

POSTED BY: Clement Roblin
Answer
6 months ago
POSTED BY: Neil Singer
Answer
6 months ago

@Clement Roblin, welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your posts and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

POSTED BY: Moderation Team
Answer
6 months ago

If you are using version 11.1 or later you can define

g[x_] = x*Log[RealAbs[x]]

Otherwise use Piecewise to avoid that derivative of g be calculated on the complexes.

POSTED BY: Gianluca Gorni
Answer
6 months ago

Hello, i did it with x*Log[RealAbs[x]] and it works perfectly !

Thanks !

POSTED BY: Clement Roblin
Answer
6 months ago

Group Abstract Group Abstract