用Octave求不定积分基本公式(21)
广告
                        {{v.name}}
不定积分基本公式(21) \(\int{ \frac{1}{x^2-a^2 } }{\rm d}x=\frac{1}{2a}{\rm ln}\lvert \frac{x-a}{x+a}\rvert+C\)
求\(\int{ \frac{1}{x^2-a^2 } }{\rm d}x\).
                    程序代码如下
                    function [text_result, numeric_result] = func75()
    pkg load symbolic;
    x = sym('x');
    a = sym('a');
    f = int(1 / (x^2 - a^2), x);
    text_result = ["\n", disp(f)];
    numeric_result = eval(f);
endfunction结果如下
                    >> [text_result, numeric_result] = func75()
text_result =
    log(-a + x)   log(a + x)
    ─────────── - ──────────
        2            2
    ────────────────────────
                a
numeric_result = (sym)
    log(-a + x)   log(a + x)
    ─────────── - ──────────
        2            2
    ────────────────────────
                a