[not a bug] Derivate of f(x) = x² abs(sin(1/x))sgn(x)

matheod shared this problem 6 years ago
Answered

Hello,


The derivate of f(x) = x² abs(sin(1 / x)) sgn(x) does not show good near +- 1/3.

The strange thing is that there is no problem at this point in the derivate (or I miss something) :

g(x) = (-abs(sin(1 / x)) sgn(x) cos(1 / x) + 2x abs(sin(1 / x)) sgn(x) sin(1 / x)) / sin(1 / x)


When zooming in/out the missing quickly appear then disappear sometime.


http://imgur.com/IhuNhZ6


    GeoGebra 5.0.106.0-3D (06 May 2015)

    Java: 1.7.0_40

    Codebase: file:/C:/Users/Matheod/AppData/Roaming/GeoGebra%205.0/jars/current/geogebra.jar

    OS: Windows 8

    Architecture: x86 / x86

    Heap: 247MB

    CAS: Giac/JNI


    GeoGebraLogger log:

    22:44:20.232 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.678255182784279:-0.5789966072459315--0.5426728641466402

    22:44:20.279 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.8671195503017762:-0.4215937204823358--0.38526997738304447

    22:44:20.326 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.6380268413727231:-0.31262249118446184--0.2762987480851705

    22:44:20.357 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.2896684011280704:-0.23392104780266398--0.19759730470337267

    22:44:20.357 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.06592826887488668:-0.21575917625301833--0.179435433153727

    22:44:20.373 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.3857649008259424:-0.19759730470337267--0.16127356160408132

    22:44:20.373 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.6469841768348272:-0.179435433153727--0.14311169005443566

    22:44:20.388 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.6469841768348272:-0.16732751878729657--0.13100377568800523

    22:44:20.388 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.9693469291259696:-0.14916564723765088--0.11284190413835957

    22:44:20.404 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:1.0546344617316237:-0.13100377568800523--0.09468003258871391

    22:44:20.420 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.24028706970945687:-0.06441024667263781--0.028086503573346487

    22:44:20.451 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:1.0133088758282356:-0.003870674840485607-0.032453068258805715

    22:44:46.851 WARN: org.geogebra.common.m.q.a[-1]: Java keycode not found:513

    22:45:16.987 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.8923797101534603:-0.12494981850479002--0.08862607540549869

    22:45:17.018 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.13927036722929415:0.014291196709160054-0.05061493980845137

    22:45:18.090 DEBUG: org.geogebra.desktop.i.w.a[-1]: not yet consumed

    22:45:18.262 DEBUG: org.geogebra.common.l.r.a[-1]: Number of registered views = 4

    * class org.geogebra.desktop.geogebra3D.b.b

    * class org.geogebra.desktop.geogebra3D.e.c.a.a

    * class org.geogebra.common.plugin.b

    * class org.geogebra.desktop.i.B

    22:45:18.294 DEBUG: org.geogebra.common.l.r.a[-1]: Number of registered views = 5

    * class org.geogebra.desktop.geogebra3D.b.b

    * class org.geogebra.desktop.geogebra3D.e.c.a.a

    * class org.geogebra.common.plugin.b

    * class org.geogebra.desktop.i.B

    * class org.geogebra.desktop.gui.m.h.E

    22:45:18.325 DEBUG: org.geogebra.desktop.gui.R.a[-1]: update menu

    22:45:18.340 DEBUG: org.geogebra.desktop.i.w.a[-1]: not yet consumed

    22:45:56.887 DEBUG: org.geogebra.desktop.i.w.a[-1]: not yet consumed

    22:45:57.048 DEBUG: org.geogebra.desktop.gui.R.a[-1]: update menu

    22:45:57.048 DEBUG: org.geogebra.desktop.i.w.a[-1]: not yet consumed

    22:47:31.936 DEBUG: org.geogebra.desktop.i.w.a[-1]: not yet consumed

    22:47:32.049 DEBUG: org.geogebra.desktop.gui.R.a[-1]: update menu

    22:47:32.065 DEBUG: org.geogebra.desktop.i.w.a[-1]: not yet consumed

    22:48:48.250 WARN: org.geogebra.common.m.q.a[-1]: Java keycode not found:522

    22:48:54.188 WARN: org.geogebra.common.m.q.a[-1]: Java keycode not found:522

    22:49:30.078 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.6627316788999279:-0.5812017942390619--0.46662540971370686

    22:49:30.111 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.8403495724269476:-0.1699377798655319--0.05815594130420995

    22:49:30.125 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.7827154201118389:0.04953631779755136-0.15859177005249958

    22:49:30.130 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:0.07091185734568901:0.15859177005249958-0.2676472223074478

    22:49:30.148 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.71130388401095:0.2485846839051602-0.35498024708071946

    22:49:30.158 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.875985987584661:0.2840498716303466-0.3904454348059059

    22:49:30.176 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.9895938883636679:0.3689129994013283-0.4727753348822314

    22:49:30.180 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:1.1610675788828373:0.4035337778949627-0.5073961133758658

    22:49:30.197 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:1.206971579956238:0.41601336084034257-0.517460293170527

    22:49:30.235 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:1.1979034867166092:0.42792569001547803-0.5270670102472491

    22:50:16.286 DEBUG: org.geogebra.common.c.r.a[-1]: FALLBACK TO BUGGY AWT:-0.2915195467874681:-0.6529425555525913--0.6164331728459909

    22:50:16.923 DEBUG: org.geogebra.desktop.gui.i.b.menuSelected[-1]: Menu opening: class org.geogebra.desktop.gui.i.b

    22:50:16.923 DEBUG: org.geogebra.desktop.gui.i.b.menuSelected[-1]: creating menu items

    22:50:17.191 DEBUG: org.geogebra.desktop.gui.i.b.menuSelected[-1]: Menu opening: class org.geogebra.desktop.gui.i.b

    22:50:17.491 DEBUG: org.geogebra.desktop.gui.i.b.menuSelected[-1]: Menu opening: class org.geogebra.desktop.gui.i.b

    22:50:58.709 DEBUG: javax.swing.JMenu.fireMenuSelected[-1]: Menu opening: class org.geogebra.desktop.gui.i.U

    22:50:58.709 DEBUG: javax.swing.JMenu.fireMenuSelected[-1]: creating menu items

    22:50:58.712 ERROR: org.geogebra.desktop.geogebra3D.g.a.a[-1]: Image /gui/images/64px/forum.gif not found

    22:50:58.714 ERROR: org.geogebra.desktop.geogebra3D.g.a.a[-1]: Image /gui/images/64px/forum.png not found


    GGB file content:

    <?xml version="1.0" encoding="utf-8"?>

    <geogebra format="5.0" version="5.0.106.0" id="210f493b-3ae3-47b4-b169-c6c94c8420ed" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/ggb...; xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLS...; >

    <gui>

    <window width="1056" height="600" />

    <perspectives>

    <perspective id="tmp">

    <panes>

    <pane location="" divider="0.35984848484848486" orientation="1" />

    </panes>

    <views>

    <view id="4097" visible="false" inframe="true" stylebar="true" location="1,1,1,1" size="400" window="100,100,700,550" />

    <view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 | 551 550 11 , 20 22 21 23 , 55 56 57 , 12 | 69 | 510 511 , 512 513 | 533 531 , 534 532 , 522 523 , 537 536 , 535 | 521 520 | 36 , 38 49 560 | 571 30 29 570 31 33 | 17 | 540 40 41 42 , 27 28 35 , 6 , 502" visible="false" inframe="false" stylebar="false" location="1,1,1" size="500" window="100,100,600,400" />

    <view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="false" location="1,1" size="300" window="100,100,600,400" />

    <view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />

    <view id="1" visible="true" inframe="false" stylebar="false" location="1" size="644" window="100,100,600,400" />

    <view id="2" visible="true" inframe="false" stylebar="false" location="3" size="380" window="100,100,250,400" />

    <view id="16" visible="false" inframe="false" stylebar="false" location="1" size="150" window="50,50,500,500" />

    <view id="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />

    <view id="64" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />

    <view id="70" visible="false" inframe="true" stylebar="true" location="1" size="150" window="50,50,500,500" />

    </views>

    <toolbar show="true" items="0 39 | 1 501 67 , 5 19 , 72 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 | 30 29 54 32 31 33 | 17 26 62 73 , 14 68 | 25 52 60 61 | 40 41 42 , 27 28 35 , 6" position="1" help="false" />

    <input show="true" cmd="true" top="algebra" />

    <dockBar show="true" east="true" />

    </perspective>

    </perspectives>

    <labelingStyle val="0"/>

    <font size="12"/>

    <graphicsSettings javaLatexFonts="false"/>

    </gui>

    <euclidianView>

    <viewNumber viewNo="1"/>

    <size width="644" height="438"/>

    <coordSystem xZero="210.49249153761917" yZero="246.69456115435005" scale="164.3413159904033" yscale="164.34131599040342"/>

    <evSettings axes="true" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>

    <bgColor r="255" g="255" b="255"/>

    <axesColor r="0" g="0" b="0"/>

    <gridColor r="192" g="192" b="192"/>

    <lineStyle axes="1" grid="10"/>

    <axis id="0" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true"/>

    <axis id="1" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true"/>

    </euclidianView>

    <spreadsheetView>

    <prefCellSize height="22"/>

    </spreadsheetView>

    <kernel>

    <continuous val="false"/>

    <usePathAndRegionParameters val="true"/>

    <decimals val="2"/>

    <angleUnit val="degree"/>

    <algebraStyle val="0"/>

    <coordStyle val="0"/>

    <angleFromInvTrig val="false"/>

    </kernel>

    <scripting blocked="false" disabled="false"/>

    <construction title="" author="" date="">

    <expression label ="f" exp="f(x) = ((x^(2) * abs(sin(1 / x))) * sgn(x))"/>

    <element type="function" label="f">

    <show object="false" label="true"/>

    <objColor r="0" g="0" b="0" alpha="0.0"/>

    <layer val="0"/>

    <labelMode val="0"/>

    <animation step="1" speed="1" type="0" playing="false"/>

    <lineStyle thickness="2" type="0" typeHidden="1"/>

    </element>

    <command name="Derivative">

    <input a0="f"/>

    <output a0="f&apos;"/>

    </command>

    <element type="function" label="f'">

    <show object="false" label="true"/>

    <objColor r="0" g="0" b="0" alpha="0.0"/>

    <layer val="0"/>

    <labelMode val="0"/>

    <lineStyle thickness="2" type="0" typeHidden="1"/>

    </element>

    <expression label ="g" exp="g(x) = ((((-abs(sin(1 / x))) * sgn(x)) * cos(1 / x)) + ((((2 * x) * abs(sin(1 / x))) * sgn(x)) * sin(1 / x))) / sin(1 / x)"/>

    <element type="function" label="g">

    <show object="true" label="true"/>

    <objColor r="0" g="0" b="0" alpha="0.0"/>

    <layer val="0"/>

    <labelMode val="0"/>

    <animation step="1" speed="1" type="0" playing="false"/>

    <lineStyle thickness="2" type="0" typeHidden="1"/>

    </element>

    </construction>

    </geogebra>


    <?xml version="1.0" encoding="utf-8"?>

    <geogebra format="5.0" version="5.0.106.0" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/ggt...; xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLS...; >

    </geogebra>


    LibraryJavaScript:


    Preferences:

    <?xml version="1.0" encoding="utf-8"?>

    <geogebra format="4.0" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/ggb...; xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLS...; >

    <gui>

    <window width="800" height="600" />

    <settings ignoreDocument="false" showTitleBar="true" />

    <labelingStyle val="0"/>

    <mouse reverseWheel="true"/>

    <font size="12"/>

    <menuFont size="-1"/>

    <tooltipSettings language="" timeout="0"/>

    <graphicsSettings javaLatexFonts="false"/>

    </gui>

    <euclidianView>

    <size width="640" height="480"/>

    <coordSystem xZero="215.0" yZero="315.0" scale="50.0" yscale="50.0"/>

    <evSettings axes="true" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="2" checkboxSize="26" gridType="0"/>

    <bgColor r="255" g="255" b="255"/>

    <axesColor r="0" g="0" b="0"/>

    <gridColor r="192" g="192" b="192"/>

    <lineStyle axes="1" grid="10"/>

    <axis id="0" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true" axisCross="0.0" positiveAxis="false"/>

    <axis id="1" show="true" label="" unitLabel="" tickStyle="1" showNumbers="true" axisCross="0.0" positiveAxis="false"/>

    </euclidianView>

    <kernel>

    <continuous val="false"/>

    <decimals val="2"/>

    <angleUnit val="degree"/>

    <algebraStyle val="0"/>

    <coordStyle val="0"/>

    <localization digits="false" labels="true"/>

    <angleFromInvTrig val="false"/>

    <casSettings timeout="5" expRoots="true"/>

    </kernel>

    <scripting blocked="false"/>

    </geogebra>


Thanks.

Comments (2)

photo
1

Hi,


the function contains division by sin(1/x), which is zero at 1/pi. Limit of g from above at 1/pi is 1, from below -1. So the correct plot should not be continuous at 1/pi, but as GeoGebra is plotting the function numerically, for certain zooms the plot may look continuos.


There is probably nothing we can do about that.


Cheers,

Zbynek

photo
1

Oh yes, I missed that x)


You can lock/delete/burn this topic :D

© 2021 International GeoGebra Institute