Message Boards Message Boards

GROUPS:

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

Posted 9 months ago
1012 Views
|
4 Replies
|
5 Total Likes
|

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

4 Replies

@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

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 9 months ago

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

Thanks !

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract