2017年3月4日土曜日

学習環境

解析入門〈1〉(松坂 和夫(著)、岩波書店)の第4章(微分法)、4.3(関数の凹凸)、問題4.3-1.を取り組んでみる。


  1. f'( x )=3 x 2 +2ax+b f''( x )=6x+2a 6x+2a=0 x= 1 3 a

  2. f'( x )= 2( 1+ x 2 )2x·2x ( 1+ x 2 ) 2 = 2( 1 x 2 ) ( 1+ x 2 ) 2 f''( x )= 4x ( 1+ x 2 ) 2 2( 1 x 2 )·2( 1+ x 2 )·2x ( 1+ x 2 ) 4 = 4x( 1+ x 2 )( 1 x 2 2+2 x 2 ) ( 1+ x 2 ) 4 = 4x( 1+ x 2 )( x 2 3 ) ( 1+ x 2 ) 4 = 4x( x 2 3 ) ( 1+ x 2 ) 3 f'( x )=0,x=±1 f''( x )=0,x=0,± 3 f( 3 )= 3 2 ,f( 1 )=1,f( 0 )=0,f( 1 )=1,f( 3 )= 3 2

    x -√3-101√3
    f'---0+++0---
    f''-0+++0---0+
    f --√3/2--1+0+1-√3/2-

    極小値: -1(x=-1)、極大値: 1(x=1)、変曲点: (-√3, -√3/2)、(0, 0)、(0, √3/2)

    コード(Emacs)

    HTML5

    <div id="graph0"></div>
    
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.6/d3.min.js" integrity="sha256-5idA201uSwHAROtCops7codXJ0vja+6wbBrZdQ6ETQc=" crossorigin="anonymous"></script>
    <script src="sample3.js"></script>    
    

    JavaScript

    let width = 500,
        height = 500,
        padding = 20,
        f = (x) => 2 * x / (1 + Math.pow(x, 2));
    
    let points = []
    
    for (let x = -5; x <= 5; x += 0.01) {
        points.push([x, f(x)]);
    }
    
    let xscale = d3.scaleLinear()
        .domain([-5, 5])
        .range([padding, width - padding]);
    let yscale = d3.scaleLinear()
        .domain([-5, 5])
        .range([height - padding, padding]);
    let xaxis = d3.axisBottom().scale(xscale);
    let yaxis = d3.axisLeft().scale(yscale);
    let svg = d3.select('#graph0')
        .append('svg')
        .attr('width', width)
        .attr('height', height);
    
    svg.selectAll('circle')
        .data(points)
        .enter()
        .append('circle')
        .attr('cx', (d) => xscale(d[0]))
        .attr('cy', (d) => yscale(d[1]))
        .attr('r', 1)
        .attr('fill', 'green');
    
    svg.append('g')
        .attr('transform', `translate(0, ${height / 2})`)
        .call(xaxis);
    
    svg.append('g')
        .attr('transform', `translate(${width / 2}, 0)`)
        .call(yaxis);
    
    
    
    

0 コメント:

コメントを投稿

Comments on Google+: