summaryrefslogtreecommitdiff
path: root/Algebra_by_P_Abbott_And_M_E_Wardle/15-Fractions.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Algebra_by_P_Abbott_And_M_E_Wardle/15-Fractions.ipynb')
-rw-r--r--Algebra_by_P_Abbott_And_M_E_Wardle/15-Fractions.ipynb364
1 files changed, 364 insertions, 0 deletions
diff --git a/Algebra_by_P_Abbott_And_M_E_Wardle/15-Fractions.ipynb b/Algebra_by_P_Abbott_And_M_E_Wardle/15-Fractions.ipynb
new file mode 100644
index 0000000..3f0eb8d
--- /dev/null
+++ b/Algebra_by_P_Abbott_And_M_E_Wardle/15-Fractions.ipynb
@@ -0,0 +1,364 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 15: Fractions"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.10: Conversion_of_R_in_terms_of_R1_and_R2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//1/R=1/R1-1/R2. get R\n",
+"clear;\n",
+"clc;\n",
+"close;\n",
+"disp('R=R1R2/(R2-R1)')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.11: solving_simple_equations_involving_algebraic_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"close;\n",
+"x=poly(0,'x');\n",
+"p1=3/(x-2);\n",
+"p2=5/(x-1);\n",
+"// given, 3/(x-2)=5/(x-1)\n",
+"for x=0.0:0.1:10.0\n",
+"if(3*(x-1)==5*(x-2))\n",
+" format(7)\n",
+"x\n",
+" break\n",
+"end\n",
+"end"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.12: Solving_algebraic_fraction_for_n.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear; \n",
+"clc;\n",
+"close;\n",
+"n=poly(0,'n');\n",
+"p1=1/(n-2);\n",
+"p2=1/(n-3);\n",
+"p=p1+p2;\n",
+"q=2/n;\n",
+"//given p=q\n",
+" z1=numer(p)*denom(q);\n",
+" z2=numer(q)*denom(p);\n",
+"//As,z1=z2. cancel the terms common on both sides\n",
+" a=z1-z2;\n",
+" n=roots(a)\n",
+" "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.1: Algebraic_fractio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//simplify (a+b)/(a^2-b^2)\n",
+"clear;\n",
+"clc;\n",
+"close;\n",
+"//as, by formula,(a^2-b^2)=(a+b)(a-b)\n",
+"mprintf('\n (a+b)/((a+b)(a-b)) => 1/(a-b) \n')\n",
+"\n",
+"\n",
+" "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.2: Simplifying_the_factors.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"close;\n",
+"x=poly(0,'x');\n",
+"p1=x^2+4*x-12;\n",
+"p2=x^2+x-6;\n",
+"p=p1/p2"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.3: Reduction_of_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//simplify 3a(a^2-4ab+4b^2)/6a(a^2+3ab-10b^2)\n",
+"clear;\n",
+"clc;\n",
+"close;\n",
+"//the factors 3a(a-2b) are common to numerator & denominator.\n",
+"mprintf('\n the fraction is :\n')\n",
+"string('(a-2b)/(2a(a+5b))')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.4: Division_of_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"close;\n",
+"x=poly(0,'x');\n",
+"p1=x;\n",
+"p2=x+1;\n",
+"p=p1/p2;\n",
+"q1=x^2;\n",
+"q2=x^2-1;\n",
+"q=q1/q2;\n",
+"p/q"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.5: Multiplication_of_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"close;\n",
+"x=poly(0,'x');\n",
+"p1=x^4-27*x;\n",
+"p2=x^2-9;\n",
+"p=p1/p2;\n",
+"q1=x^2+3*x+9;\n",
+"q2=x+3;\n",
+"q=q1/q2;\n",
+"p/q"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.6: Subtraction_of_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//simplify a/(a-b) - a^2/(a^2-b^2)\n",
+"clear;\n",
+"clc;\n",
+"close;\n",
+"//as, (a^2-b^2)=(a+b)(a-b),substitute it.\n",
+"mprintf('\n the fraction is :\n')\n",
+"ans=string('ab/((a+b)(a-b))')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.7: Fraction_Subtraction.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//3/(a-b)-(2a+b)/(a^2-b^2)\n",
+"clear;\n",
+"clc;\n",
+"close;\n",
+"mprintf('\n on factorizing, the expression becomes \n');\n",
+"//3/(a-b)-(2a+b)/(a+b)(a-b) => (3a+3b-2a-b)/(a+b)(a-b)\n",
+"string('(a+2b)/((a+b)(a-b))')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.8: Subtraction_of_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"\n",
+"clear;\n",
+"clc;\n",
+"close;\n",
+"x=poly(0,'x');\n",
+"p1=x-1;\n",
+"p2=x^2-x-2;\n",
+"p=p1/p2;\n",
+"q1=x+2;\n",
+"q2=x^2+4*x+3;\n",
+"q=q1/q2;\n",
+"t=p-q;\n",
+"y=numer(t) //numerator of t\n",
+"z=factors(denom(t))//factors of denominator of t (more simplified form)\n",
+"disp('val=(1+2x)/(1+x)(-2+x)(3+x)')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.9: Division_of_fractions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//x/(x-(1/x))\n",
+"clear; \n",
+"clc;\n",
+"close;\n",
+"x=poly(0,'x');\n",
+"p1=x;\n",
+"p2=1/x;\n",
+"p3=p1-p2;\n",
+"p=p1/p3"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}